Skip to content

fix(web): drop revoked handles from the directory - #350

Merged
blockchain-maxis merged 2 commits into
blockchain-maxis:mainfrom
kaylachi:fix/directory-revoked-190
Sep 2, 2026
Merged

fix(web): drop revoked handles from the directory#350
blockchain-maxis merged 2 commits into
blockchain-maxis:mainfrom
kaylachi:fix/directory-revoked-190

Conversation

@kaylachi

Copy link
Copy Markdown
Contributor

Closes #190

apps/web/lib/directory.ts reconstructs the handle directory from the registry event stream, but decodeEvent accepted only claimed and released. A handle removed via the contract's admin_revoke (which emits revoked, lib.rs:219) therefore kept appearing: it failed the resolve confirmation so it was never labelled bound, yet still rendered as an entry — exactly wrong for a handle revoked for abuse or impersonation.

Change

  • decodeEvent now accepts revoked alongside claimed/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 as released does — no logic change there, just clarified comments.
  • Doc/type touch-ups so the revoked kind is reflected in RawEvent and the surrounding comments.

Tests (apps/web/lib/directory.test.ts)

  • decodeEvent accepts a revoked event and still rejects unrelated topics.
  • reduceBindings drops a revoked handle (as with release) and allows re-claim after revoke.

`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
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@netlify

netlify Bot commented Aug 30, 2026

Copy link
Copy Markdown

Deploy Preview for stellar-signet ready!

Name Link
🔨 Latest commit c2bbfcb
🔍 Latest deploy log https://app.netlify.com/projects/stellar-signet/deploys/6a9816684d070800076bd1f4
😎 Deploy Preview https://deploy-preview-350--stellar-signet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@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
blockchain-maxis merged commit 5c32908 into blockchain-maxis:main Sep 2, 2026
10 of 11 checks passed
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.

Directory ignores revoked events, so revoked handles keep appearing

2 participants