chore(nostr-feed): delete dead-code ReactionService + useReactions duplicates #80

Merged
padreug merged 1 commit from chore/dedup-reaction-service into dev 2026-05-29 19:33:28 +00:00
Owner

Summary

The reaction capability is not affected — only an unused duplicate file pair is removed. The live ReactionService (registered in DI, used by forum + nostr-feed components) stays at src/modules/base/nostr/ReactionService.ts.

Two files deleted:

  • src/modules/nostr-feed/services/ReactionService.ts (585 lines) — defined a class with the same name as the base one, but never registered in DI. The class was a strict subset of the base copy (missing toggleLikeEvent / toggleDislikeEvent) — leftover from before the implementation was promoted to base/.
  • src/modules/nostr-feed/composables/useReactions.ts (102 lines) — identical to src/modules/base/composables/useReactions.ts except for the type-import path and a one-word doc-comment delta. Had zero callers; the one consumer (NostrFeed.vue:15) already imports from @/modules/base/composables/useReactions.

Diff verification (no unique behavior lost)

I diffed both files against their base counterparts before deletion. The nostr-feed copies' divergences:

  • Comments only (e.g. "Deletion monitoring is now handled by FeedService's consolidated subscription") — same delegation behavior in both
  • Method ordering differs — same methods, different position in file
  • Missing methodstoggleLikeEvent / toggleDislikeEvent exist only in the base copy

No port-forward needed; the base copy is strictly more capable. NostrFeed.vue:99 already uses toggleLike (the composable wrapper that calls toggleLikeEvent on the base service) and has been doing so since before this PR.

Why now

Blocker for the phase-2 bucket-B migration per aiolabs/lnbits#9 signer-abstraction adoption. Each finalizeEvent(eventTemplate, prvkeyBytes) call site in the webapp needs to migrate off currentUser.value.prvkey. Touching both copies of ReactionService would waste effort and risks one branch silently keeping a prvkey-read path alive.

Capability post-merge

Reactions continue to work exactly as today. Forum reactions and nostr-feed reactions both route through the same live base/nostr/ReactionService.ts via DI injection of SERVICE_TOKENS.REACTION_SERVICE. When the nostr-feed module gets reprioritized in the future, any new component just imports useReactions from @/modules/base/composables/useReactions (same path the existing NostrFeed.vue uses).

Test plan

  • vue-tsc --noEmit clean post-deletion (no broken imports)
  • Manual smoke on aio-demo after dev deploy: like / unlike / dislike / undislike a forum submission (the live consumer of REACTION_SERVICE); confirm reactions still publish to relays and count back

Refs

  • Closes #78
  • Sibling cleanup: #79 (ScheduledEventService dedup — same pattern, separate PR)
  • Parent initiative: aiolabs/lnbits#9 (signer abstraction / bunker integration)
  • Cross-session coordination log: ~/dev/coordination/log.md entries 2026-05-28T19:45Z (lnbits flagged the duplicate) and 2026-05-28T22:00Z (audit-pass that confirmed the dead-code finding)

🤖 Generated with Claude Code

## Summary The reaction capability is **not** affected — only an unused duplicate file pair is removed. The live `ReactionService` (registered in DI, used by forum + nostr-feed components) stays at `src/modules/base/nostr/ReactionService.ts`. Two files deleted: - `src/modules/nostr-feed/services/ReactionService.ts` (585 lines) — defined a class with the same name as the base one, but **never registered in DI**. The class was a strict subset of the base copy (missing `toggleLikeEvent` / `toggleDislikeEvent`) — leftover from before the implementation was promoted to `base/`. - `src/modules/nostr-feed/composables/useReactions.ts` (102 lines) — identical to `src/modules/base/composables/useReactions.ts` except for the type-import path and a one-word doc-comment delta. Had zero callers; the one consumer (`NostrFeed.vue:15`) already imports from `@/modules/base/composables/useReactions`. ## Diff verification (no unique behavior lost) I diffed both files against their base counterparts before deletion. The nostr-feed copies' divergences: - **Comments only** (e.g. "Deletion monitoring is now handled by FeedService's consolidated subscription") — same delegation behavior in both - **Method ordering differs** — same methods, different position in file - **Missing methods** — `toggleLikeEvent` / `toggleDislikeEvent` exist only in the base copy No port-forward needed; the base copy is strictly more capable. `NostrFeed.vue:99` already uses `toggleLike` (the composable wrapper that calls `toggleLikeEvent` on the base service) and has been doing so since before this PR. ## Why now Blocker for the phase-2 bucket-B migration per `aiolabs/lnbits#9` signer-abstraction adoption. Each `finalizeEvent(eventTemplate, prvkeyBytes)` call site in the webapp needs to migrate off `currentUser.value.prvkey`. Touching both copies of `ReactionService` would waste effort and risks one branch silently keeping a prvkey-read path alive. ## Capability post-merge Reactions continue to work exactly as today. Forum reactions and nostr-feed reactions both route through the same live `base/nostr/ReactionService.ts` via DI injection of `SERVICE_TOKENS.REACTION_SERVICE`. When the nostr-feed module gets reprioritized in the future, any new component just imports `useReactions` from `@/modules/base/composables/useReactions` (same path the existing `NostrFeed.vue` uses). ## Test plan - [x] `vue-tsc --noEmit` clean post-deletion (no broken imports) - [ ] Manual smoke on `aio-demo` after `dev` deploy: like / unlike / dislike / undislike a forum submission (the live consumer of `REACTION_SERVICE`); confirm reactions still publish to relays and count back ## Refs - Closes #78 - Sibling cleanup: #79 (ScheduledEventService dedup — same pattern, separate PR) - Parent initiative: `aiolabs/lnbits#9` (signer abstraction / bunker integration) - Cross-session coordination log: `~/dev/coordination/log.md` entries `2026-05-28T19:45Z` (lnbits flagged the duplicate) and `2026-05-28T22:00Z` (audit-pass that confirmed the dead-code finding) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The nostr-feed module had its own copies of ReactionService and
useReactions that were never wired in — the live implementations
live in src/modules/base/. The nostr-feed copy of ReactionService
was a strict subset of the base copy (missing toggleLikeEvent /
toggleDislikeEvent) and was never registered in DI. The
nostr-feed copy of useReactions was identical to the base copy
modulo the type import path; the one consumer (NostrFeed.vue)
already imports from the base path.

Closes #78.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
padreug deleted branch chore/dedup-reaction-service 2026-05-29 19:33:28 +00:00
Sign in to join this conversation.
No description provided.