Description[Sync] Maintain a global_id mapping to update UserEvents that references navigations.
UserEvents are created and reference sessions data by global_id. It is
important that they travel over the wire in this format, as this is how
the sessions data is keyed into Footprints, and the sync server cannot
feasibly perform a persistent read before writing new UserEvents.
Because global_id is forced to be part of the wire interface and
specifics, it is also conveniently part of the interface to the
UserEventService.
However, while this global_id is seemingly sacred to sync, it comes
from simply the timestmap of the navigation entry. And if a page is
reloaded, this value can change. A problem arises when a UserEvent
references a navigation by a global_id that was updated and the old
value is never going to reach the sync server.
To fix we maintain two sets of mappings, one that allows us to map old
global_ids to new global_id, and one that allows us to efficiently look
up uncommitted UserEvents by global_id, so that if we get either a new
global_id or a new UserEvent we can quickly fix the global_id.
BUG=747621
Review-Url: https://codereview.chromium.org/2958303002
Cr-Commit-Position: refs/heads/master@{#488826}
Committed: https://chromium.googlesource.com/chromium/src/+/a58a1f014663671847efd294313b99fe71e1a6bf
Patch Set 1 #Patch Set 2 : Hopefully fix iOS compile issue. #
Total comments: 20
Patch Set 3 : Updates for holte@, hopefully fix for iOS compile issue. #Patch Set 4 : Updates for pnoland #Patch Set 5 : Actually save global_id_mapper.h changes #
Total comments: 4
Patch Set 6 : Rebase #
Total comments: 1
Messages
Total messages: 44 (32 generated)
|