Closed Bug 1202627 Opened 5 years ago Closed 5 years ago

Use Kinto.js dbPrefix option to avoid data clashes between accounts

Categories

(Firefox OS Graveyard :: Sync, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
FxOS-S8 (02Oct)

People

(Reporter: mbdejong, Assigned: mbdejong)

References

Details

(Whiteboard: [partner-cherry-picked<2015/11/10>])

Attachments

(1 file)

Since https://github.com/Kinto/kinto.js/issues/119 was fixed in https://github.com/Kinto/kinto.js/pull/111 we can pass the user's email address as a dbPrefix in kinto.js. This will avoid mixing up data of different users.
Assignee: nobody → mbdejong
Depends on: 1196239
Should also try out https://github.com/Kinto/kinto.js/issues/114#issuecomment-134299911 to see if it's possible to clean up unused databases (although probably we don't want to clean up anything unless there is a reason to believe that local data is corrupt, or if a disk space shortage is detected on the phone's internal storage).
Optimization we can do as a part of this bug:
Once we can keep databases of different accounts separate, we can optimize the SyncEngine constructor so that it does not needlessly retrieve meta/global and crypto/keys if local copies of them are already available.
Blocks: 1204432
Target Milestone: --- → FxOS-S8 (02Oct)
Blocks: 1195647
No longer blocks: 1204432
Blocks: fxos-sync
No longer blocks: 1195647
Attachment #8664144 - Flags: review?(ferjmoreno)
Attachment #8664144 - Flags: review?(ferjmoreno) → review+
https://github.com/mozilla-b2g/gaia/commit/33f3aeab5437587cddd5c752d3818868486cc9f0
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Whiteboard: partner-cherry-pick
Whiteboard: partner-cherry-pick
Whiteboard: [partner-cherry-pick]
Whiteboard: [partner-cherry-pick] → [partner-cherry-picked<2015/11/10>]
You need to log in before you can comment on or make changes to this bug.