fix(react): gate reads and decrypts on permit validity, not existence - #305
fix(react): gate reads and decrypts on permit validity, not existence#305alexshchur wants to merge 2 commits into
Conversation
useCofheReadContract enabled its query whenever an active permit merely existed, while its own disabledDueToMissingValidPermit flag checks isValid — so an expired active permit passed the gate, fired the ciphertext read + decrypt pipeline, and produced guaranteed 'Permit is expired' failures. useCofheDecrypt had no permit gate at all, so a ciphertext cached while the permit was valid kept re-firing doomed decrypts after expiry. Both gates now require a currently valid active permit, matching the reported flag.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
useCofheReadContractenabled its query whenever an active permit merely existed, while its owndisabledDueToMissingValidPermitflag checksisValid— so an expired active permit passed the gate, fired the ciphertext read + decrypt pipeline, and produced guaranteedPermit is expiredfailures in the error surface.useCofheDecrypthad no permit gate at all; since ciphertext reads are cached, an input fetched while the permit was valid kept re-firing doomed decrypts after expiry.Both gates now require a currently valid active permit, matching the flag the hook already reports (the exported helper's param is renamed
hasActivePermit→hasValidActivePermitaccordingly). No behavior change for valid permits; consumers keyed ondisabledDueToMissingValidPermitsee consistent semantics.Tests: existing suite passes (8/8) after building the workspace deps.