Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 3890a5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@kriss39 is attempting to deploy a commit to the Fhenix Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…-context-isolation # Conflicts: # packages/react/src/hooks/useCofheDecrypt.ts # packages/react/src/hooks/useCofheDecryptionActivity.ts # packages/react/src/hooks/useCofheReadContractAndDecrypt.ts
Master now keys decrypts by chain. The active ACP is also per account, so the same handle decrypted under one account was still served from the cache after switching account or ACP on that chain. Append the account and ACP hash to the key; the activity hook's ctHash index is unchanged.
|
Merged master and reworked this on top of #364. The chain half of the fix is now covered there, so the PR only adds the account and ACP hash to the key (appended, so the activity hook's indices are unchanged). |
|
Thanks for catching this! #388 has since fixed it: the decrypt cache key now includes the ACP hash, which already covers the account, so I'm closing this as superseded. |
What changed
The decrypt query key now also carries the connected account and its active ACP hash:
['decryptCiphertext', chainId, ctHash, utype, account, acpHash].#364 already added the chain to the key. The active ACP is stored per chain and per account, though, so after switching account (or ACP) on the same chain the same handle still resolved to the entry decrypted under the previous account. React Query returns cached data for a disabled query too, and the entry is persisted, so the new account saw that plaintext even without a valid ACP of its own.
The two fields are appended at the end, so
useCofheDecryptionActivitystill reads the ctHash fromk[2].useCofheReadContractAndDecryptincludes them in the key it evicts.Testing
pnpm --filter @cofhe/react run check:typespnpm --filter @cofhe/react test(45 passed)