Skip to content

feat: Dedupe and invalidate in-flight wallet address fetches - #79

Closed
ashaltykou-innowise wants to merge 1 commit into
tetherto:mainfrom
ashaltykou-innowise:feat/address-inflight-handling
Closed

feat: Dedupe and invalidate in-flight wallet address fetches#79
ashaltykou-innowise wants to merge 1 commit into
tetherto:mainfrom
ashaltykou-innowise:feat/address-inflight-handling

Conversation

@ashaltykou-innowise

Copy link
Copy Markdown

Summary

  • Deduplicate concurrent AddressService.getAddress calls for the same wallet/network/account so only one HRPC request runs.
  • Introduce wallet/global epochs (invalidateWallet / invalidateAll) so late responses after delete, lock, or reset do not write stale addresses or loading flags into the store.
  • Hook invalidation into wallet delete (useWalletManager) and worklet teardown (WorkletLifecycleService), with unit coverage for dedupe and stale-write skipping.

Test plan

  • Run AddressService unit tests (dedupe, invalidateWallet, invalidateAll, fresh fetch after invalidate)
  • Delete a wallet while address fetch is in flight — store should not retain addresses for that wallet
  • Lock/reset (worklet dispose) while address fetch is in flight — cleared address state should not be repopulated
  • Concurrent getAddress for the same key results in a single HRPC call; different keys still fetch in parallel

@nulllpc

nulllpc commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Closed in favor of #87

@nulllpc nulllpc closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants