Fixes feed sync bugs after conflicts. (#1074)
SyncedSettings.set() caches values. If an object passed to set() is modified after the call then get() returns that modified object.
This commit is contained in:
parent
1b5c7aa6d8
commit
076bdadb29
3 changed files with 23 additions and 3 deletions
10
test/tests/syncedSettingsTest.js
Normal file
10
test/tests/syncedSettingsTest.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
describe('Zotero.SyncedSettings', function() {
|
||||
it('should not affect cached value when modifying the setting after #set() call', function* () {
|
||||
let setting = {athing: 1};
|
||||
yield Zotero.SyncedSettings.set(Zotero.Libraries.userLibraryID, 'setting', setting);
|
||||
|
||||
setting.athing = 2;
|
||||
let storedSetting = Zotero.SyncedSettings.get(Zotero.Libraries.userLibraryID, 'setting');
|
||||
assert.notDeepEqual(setting, storedSetting);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue