Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preference change does not fire an onPreferencedChanged event #7685

Open
kenneth-marut-work opened this issue Apr 28, 2020 · 3 comments
Open
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help preferences issues related to preferences

Comments

@kenneth-marut-work
Copy link
Contributor

kenneth-marut-work commented Apr 28, 2020

Bug Description:

While working on the new preferences-ui we came across a bug related to the preference-service that has been causing some strange and unpredictable behavior on the Electron version (and also appears on master with the original preferences UI). When setting a preference value for some items, most noticeably Application Confirm Exit in User scope, the preference service does not properly register an onPreferenceChanged event, and thus does not update the value in the UI. This has sometimes occurred for other preference items in folder scopes as well, but is consistently an issue for Application Confirm Exit Please see the attached screen recording with console output:

Steps to Reproduce:

  1. Set up a log for the preferenceService.onPreferenceChanged event (in e.g. packages/preferences/src/browser/preferences-decorator.ts around line 36)
  2. Build for Electron
  3. Run in Electron
  4. Open Preferences in User scope
  5. Modify preferences using tree view and save the JSON
  6. Every modify + save cycle should fire an onPreferenceChanged event.
  7. Modify 'Application: Confirm Exit' and save
  8. Observe that no event fires

screenrecord

Additional Information

  • Operating System:
    Linux (RHEL7 & Ubuntu tested)
  • Theia Version:
    Electron 1.0.0
@vince-fugnitto vince-fugnitto added bug bugs found in the application help wanted issues meant to be picked up, require help preferences issues related to preferences labels Apr 28, 2020
@colin-grant-work
Copy link
Contributor

I also encountered the same behavior on an up-to-date MacOS build

@akosyakov
Copy link
Member

We generally don't have good test coverage for preference events and don't test whether they are compatible with VS Code extensions' expectations.

@colin-grant-work
Copy link
Contributor

colin-grant-work commented Apr 29, 2020

I'm not certain of the provenance of all of the preferences tested - some may come from extensions - but this test was run with the Theia example/electron app on Friday's (24/4) master branch, and the the preference that's giving us the most trouble at the moment is application.confirmExit, which looks like it belongs to the set of core Theia preferences defined in this file: packages/core/src/browser/core-preferences.ts.

It’s also worth noting that it really doesn’t seem to occur in the browser app - certainly not with the same regularity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help preferences issues related to preferences
Projects
None yet
Development

No branches or pull requests

4 participants