Skip to content

fix: link prices and clear caches after on-demand address syncs - #1156

Merged
Klakurka merged 1 commit into
masterfrom
fix/on-demand-sync-prices-and-cache
Nov 26, 2026
Merged

Klakurka merged 1 commit into
masterfrom
fix/on-demand-sync-prices-and-cache

Conversation

@Klakurka

Copy link
Copy Markdown
Member

syncAddresses commits through the bulk sync path (createManyTransactionsForSync), which defers price linking and cache updates to the sync job's connectAllTransactionsToPrices + cache invalidation. That job only runs at startup, but syncAndSubscribeAddresses is also called on demand from the app (paybutton create/update, unknown address lookup, client payment for an unregistered address). Txs synced that way stayed at 0/2 price links until the next restart, so cache rebuilds skipped them ("[CACHE] Skipping tx ... missing price links (0/2)") and they were missing from payments and the dashboard; a cache rebuilt mid-sync also stayed partial.

After an on-demand sync, link prices for the synced addresses' unpriced txs (connectTransactionsToPricesForAddresses) and drop their payment, balance and users' dashboard caches (CacheSet.addressesSynced) so they rebuild from the DB. A price-linking failure is logged and the caches are still invalidated.

syncAddresses commits through the bulk sync path (createManyTransactionsForSync),
which defers price linking and cache updates to the sync job's
connectAllTransactionsToPrices + cache invalidation. That job only runs at
startup, but syncAndSubscribeAddresses is also called on demand from the app
(paybutton create/update, unknown address lookup, client payment for an
unregistered address). Txs synced that way stayed at 0/2 price links until the
next restart, so cache rebuilds skipped them ("[CACHE] Skipping tx ... missing
price links (0/2)") and they were missing from payments and the dashboard; a
cache rebuilt mid-sync also stayed partial.

After an on-demand sync, link prices for the synced addresses' unpriced txs
(connectTransactionsToPricesForAddresses) and drop their payment, balance and
users' dashboard caches (CacheSet.addressesSynced) so they rebuild from the DB.
A price-linking failure is logged and the caches are still invalidated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Klakurka Klakurka self-assigned this Nov 26, 2026
@Klakurka Klakurka added the bug Something isn't working label Nov 26, 2026
@Klakurka
Klakurka merged commit d23f416 into master Nov 26, 2026
3 checks passed
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant