// Remembers, per study, the server copy's lastEdited that this device last saw — the "base" a save is // checked against so another device's newer copy is never overwritten silently. Kept in memory: it is // rebuilt from the server's list each time you sign in. const base = new Map(); export const getSyncBase = (id) => base.get(id); export const setSyncBase = (id, lastEdited) => { if (Number.isFinite(lastEdited)) base.set(id, lastEdited); }; export const clearSyncBase = (id) => base.delete(id); export const resetSyncBases = () => base.clear();