Files
amethyst/amethyst
Claude dfc237d27b refactor(napplet): audit fixes — sub lifecycle, broker/http caching, shim asset
Code-audit pass over the napplet subsystem (see
plans/2026-06-21-napplet-code-audit.md):

Correctness:
- Live subscriptions now store the exact INostrClient that opened them, so
  teardown unsubscribes from the right account even after an account
  switch (previously leaked on the original account).
- Multi-relay subscriptions emit a single relay.eose via an eoseSent
  latch, instead of one per relay (the SDK expects one).

Performance:
- The broker is cached per account (reference identity) instead of rebuilt
  on every request.
- The blob OkHttpClient is cached and reused (keyed by Tor port) for
  connection pooling, instead of a new client per fetch.

Refactor / docs:
- Moved the 105-line injected shim from a Kotlin string constant to
  assets/napplet/shim.js (loaded once like shell.html); corrected stale
  onChanged / subscribe comments.

Deferred (documented with rationale): cross-relay event dedup,
background pause/resume of live subs, request ordering, and the
recommended NappletProtocolJson -> commons/jvmAndroid move.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ncMHuBBVHEf7spAoSssde
2026-06-21 22:01:57 +00:00
..
2024-06-24 14:13:55 -04:00