-
Notifications
You must be signed in to change notification settings - Fork 234
chore(storage-mixin): remove from preferences storage COMPASS-6946 #4600
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
Conversation
}); | ||
|
||
it('notifies callers of preferences changes after fetchPreferences', async function () { | ||
it.skip('handles concurrent modifications to different preferences', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just leaving a comment here about the .skip()
…odb-js/compass into storage-mixin-from-user-preferences
): Promise<AllPreferences> { | ||
const keys = Object.keys(attributes) as (keyof UserPreferences)[]; | ||
const originalPreferences = await this.fetchPreferences(); | ||
const originalPreferences = this.getPreferences(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to mention it explicitly and make sure it’s intentional, this means that if a user has two Compass instances running and changes preferences first in one and then the other, now that second write always undoes the first one, rather than merging the updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! This seems like a breaking change i am introducing. I think I need to align this and avoid any unwanted behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While going through the changes, I stumbled on this page and realized that electron has a single main process and all the browser windows share it. So any change made in any Compass window should reflect on other and should not be out of sync. Plus I also tested it and works just fine. Let me know what you think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two instances of the app or two windows in the same app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple windows within the same app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mabaasit Right, that’s how it works on macOS or when you use the “New Connection” button. On other OSes, starting Compass multiple times through the regular mechanism for doing so will create actual different Compass main processes.
Again, no particularly strong feelings here and this is still a change in behavior that we can make, we should just be intentional about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added 2e12f02 to address this.
However, when we have two different compass instances and user updates any preferences it will not be reflected in other one unless some user action triggers fetching of preferences (which is the current behaviour).
Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Co-authored-by: Anna Henningsen <anna.henningsen@mongodb.com>
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes