Skip to content

Misleading error when trying to change location prefs #1036

@NullVoxPopuli

Description

@NullVoxPopuli
❯ sudo -u prey /usr/lib/prey/current/bin/prey config settings update 'control-panel.permissions.wifi_location' true

EXCEPTION! Cannot read properties of undefined (reading 'possiblevalues')
TypeError: Cannot read properties of undefined (reading 'possiblevalues')
    at exports.update (/usr/lib/prey/versions/1.13.20/lib/conf/settings.js:51:26)
    at /usr/lib/prey/versions/1.13.20/lib/conf/cli.js:58:11

however:

❯ sudo -H -u prey bash -c "/usr/lib/prey/current/bin/prey config settings list"

  # shows
  # ...
  'control-panel.send_location_on_connect': false,
  'control-panel.permissions.wifi_location': 'false',
  'control-panel.permissions.native_location': 'false'
}

I've tried 'true' as well as true -- same response each time.

Doing some debugging, I see at line 51:

{ 
  dataFromName: [], 
  dataToSave: true,
  values: {
    positional: [ 'control-panel.permissions.wifi_location', 'true' ],
    key: 'true'
  },
  reqPreyConfig: [
    // missing wifi_location, native_location, and send_location_on_connect
  ]
}

so, if anything, I'd say that the list command is including data it should not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions