Fix pull silently skipping on fresh browser install; show last pull time
Three issues in the Gist pull flow on a browser with no prior data:
1. _getAllData() returned Date.now() as lastModified when ss_lastModified
was unset (fresh install). The timestamp check in pullFromGist then
saw the Gist data as older than local, silently returned imported:false
("Already up to date") without importing anything or prompting for
auth. Fixed by using || 0 so a browser with no data always accepts
remote data as newer.
2. _applyData now persists ss_last_pull_time and ss_last_pull_source so
the last successful pull survives page reloads.
3. The Gist section on the options page now shows "Last pulled: <time>"
alongside the Gist ID on load, so both browsers display their sync
status rather than showing nothing on first open.
https://claude.ai/code/session_01QJnEnLfbXKR5FSCQ3Qfs53
This commit is contained in:
+5
-2
@@ -901,7 +901,7 @@ const SilentSendSync = {
|
||||
const result = await api.storage.local.get('ss_lastModified');
|
||||
return {
|
||||
version: '1',
|
||||
lastModified: result.ss_lastModified || Date.now(),
|
||||
lastModified: result.ss_lastModified || 0,
|
||||
identity: identity || {},
|
||||
mappings: mappings || [],
|
||||
settings: settings || {},
|
||||
@@ -924,9 +924,12 @@ const SilentSendSync = {
|
||||
}
|
||||
|
||||
// Metadata stays plaintext
|
||||
const now = Date.now();
|
||||
await api.storage.local.set({
|
||||
ss_lastModified: data.lastModified,
|
||||
ss_sync_notification: { source, time: Date.now() },
|
||||
ss_sync_notification: { source, time: now },
|
||||
ss_last_pull_time: now,
|
||||
ss_last_pull_source: source,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user