Skip to content

Fix/qdn publishing check#34

Merged
nbenaglia merged 3 commits into
masterfrom
fix/qdn-publishing-check
Feb 27, 2026
Merged

Fix/qdn publishing check#34
nbenaglia merged 3 commits into
masterfrom
fix/qdn-publishing-check

Conversation

@nbenaglia
Copy link
Copy Markdown
Collaborator

@nbenaglia nbenaglia commented Feb 27, 2026

#30:

  • Old-format migration now writes lastUpdated: 0 instead of Date.now(). Any valid QDN timestamp (> 0) will always be considered newer, so the startup sync fetches from QDN instead of publishing spuriously.

  • Before publishing when QDN returns null, the code now reads a q-wallets-addressbook-published-${coinType} sentinel key from localStorage. If the hash of local entries matches the last successfully published hash, the publish (and its permission dialog) is skipped. This prevents repeated proposals during QDN propagation delay.
    publishToQDN now captures lastUpdated = Date.now() before the async operations and returns it (or null on failure). Both call-sites in the startup sync use the returned value to write localStorage, so local and QDN timestamps are identical after a publish — the next startup goes straight to the equal-timestamp path with no further hash comparison or dialog.

  • publishToQDN also writes the published hash to the sentinel key on every successful publish (startup or debounced), keeping the propagation-delay guard in sync.

@nbenaglia nbenaglia merged commit d274689 into master Feb 27, 2026
1 check passed
@nbenaglia nbenaglia deleted the fix/qdn-publishing-check branch February 27, 2026 22:00
@nbenaglia nbenaglia added the enhancement New feature or request label Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant