Skip to content

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

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

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 self-requested a review August 3, 2026 16:03
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.

1 participant