fix(web): drop revoked handles from the directory - #350
Merged
blockchain-maxis merged 2 commits intoSep 2, 2026
Conversation
`decodeEvent` accepted only `claimed` and `released`, so a handle removed via the registry's `admin_revoke` (which emits `revoked`) kept rendering in the directory. It failed the `resolve` confirmation and so was never labelled bound, but still showed as an entry — the wrong outcome for a handle revoked for abuse or impersonation. Accept `revoked` in `decodeEvent` (mirroring the indexer's attestation worker) so it reaches `reduceBindings`, whose unbind branch already removes the handle exactly as `released` does. Tests: decodeEvent accepts `revoked` / rejects unrelated topics, and reduceBindings drops a revoked handle and allows re-claim after revoke. Closes blockchain-maxis#190
|
@kaylachi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
✅ Deploy Preview for stellar-signet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@kaylachi is attempting to deploy a commit to the blockchainmaxis-8449's projects Team on Vercel. A member of the Team first needs to authorize it. |
blockchain-maxis#323 added `transferred` handling to the directory after this PR was opened, so both files conflicted. Resolved to carry all four event kinds rather than either pair: - RawEvent is now claimed | released | revoked | transferred, keeping main's optional `from` for transfers. - decodeEvent: main moved the kind check below the `transferred` branch (it decodes a [from, wallet] pair rather than a bare address), so this branch's earlier guard was redundant there; widened main's later check with `revoked` instead of keeping both. - reduceBindings: `claimed`/`transferred` bind, `released`/`revoked` unbind. - The module doc keeps main's fuller two-source description, with the event list widened. Also fixed a test that stopped meaning what its name says: 'decodeEvent ignores an unrelated topic' used `transferred` as the unrelated topic, which blockchain-maxis#323 made a handled one. It still passed, but only because the fixture's payload is a bare address where the transferred branch wants a [from, wallet] pair — so it would not have caught a regression. Switched to a genuinely unhandled topic. Verified the contract really is the source of these: admin_revoke emits `revoked` (lib.rs:227) and the indexer's attestation worker already treats it as an unbind, so the directory was the only reader ignoring it. 270/270 web tests pass; typecheck and lint clean.
blockchain-maxis
merged commit Sep 2, 2026
5c32908
into
blockchain-maxis:main
10 of 11 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #190
apps/web/lib/directory.tsreconstructs the handle directory from the registry event stream, butdecodeEventaccepted onlyclaimedandreleased. A handle removed via the contract'sadmin_revoke(which emitsrevoked,lib.rs:219) therefore kept appearing: it failed theresolveconfirmation so it was never labelled bound, yet still rendered as an entry — exactly wrong for a handle revoked for abuse or impersonation.Change
decodeEventnow acceptsrevokedalongsideclaimed/released, mirroring the indexer's attestation worker (apps/indexer/src/workers/attestation.ts:77), which already handles it.reduceBindings' existing unbind branch then removes the handle exactly asreleaseddoes — no logic change there, just clarified comments.revokedkind is reflected inRawEventand the surrounding comments.Tests (
apps/web/lib/directory.test.ts)decodeEventaccepts arevokedevent and still rejects unrelated topics.reduceBindingsdrops a revoked handle (as with release) and allows re-claim after revoke.