chore: delete legacy ScheduledEventService (duplicate of TaskService) #79

Closed
opened 2026-05-28 11:47:42 +00:00 by padreug · 0 comments
Owner

Summary

src/modules/nostr-feed/services/ScheduledEventService.ts is a legacy duplicate of src/modules/tasks/services/TaskService.ts. The DI token is already marked deprecated and FeedService already routes incoming event handling to TASK_SERVICE, but the publish-side hasn't been deduped yet.

This is the direct parallel to #78 (ReactionService dedup) and blocks phase-2 bucket-B migration for the same reason: touching every finalizeEvent site twice or leaving dead-code paths that still try to read prvkey.

Evidence

  • src/core/di-container.ts:142-143:
    /** @deprecated Use TASK_SERVICE instead */
    SCHEDULED_EVENT_SERVICE: Symbol('scheduledEventService'),
    
  • src/modules/nostr-feed/services/FeedService.ts:75-77:
    // ScheduledEventService moved to tasks module - use tryInjectService for backward compat
    this.scheduledEventService = tryInjectService(SERVICE_TOKENS.TASK_SERVICE)
    
  • Both services define identical methods: claimTask / startTask / completeEvent / unclaimTask / deleteTask / updateTaskStatus.
  • Both publish ONLY kind 31925 (RSVP/status) and kind 5 (deletion). Neither publishes kind 31922; the only kind-31922 publish site is ActivitiesNostrService.publishCalendarEvent (bucket A; tracked by the broader #9 migration).
  • Live callers today:
    • ScheduledEventServicenostr-feed/composables/useScheduledEventsnostr-feed/components/NostrFeed.vue
    • TaskServicetasks/composables/useTaskstasks/components/TaskList.vue
      Same domain, two callers, two implementations.

Concrete proposal

  1. Delete src/modules/nostr-feed/services/ScheduledEventService.ts.
  2. Delete src/modules/nostr-feed/composables/useScheduledEvents.ts.
  3. Repoint src/modules/nostr-feed/components/NostrFeed.vue from useScheduledEventsuseTasks (or eliminate the call site if the feed page is moving away from inline task interaction).
  4. Remove the deprecated SCHEDULED_EVENT_SERVICE token from src/core/di-container.ts.
  5. Audit src/modules/nostr-feed/services/FeedService.ts:75-77 — the tryInjectService(SERVICE_TOKENS.TASK_SERVICE) aliasing-to-this.scheduledEventService field name is misleading post-deletion. Either rename the field or accept the rename as part of this cleanup.

Why this matters now

Blocker for phase-2 bucket-B migration per the aiolabs/lnbits#9 signer-abstraction adoption. The migration touches every finalizeEvent(eventTemplate, prvkeyBytes) site; doing it on both copies wastes effort and risks one branch silently keeping the prvkey-read path alive.

Acceptance

  • nostr-feed/services/ScheduledEventService.ts removed.
  • nostr-feed/composables/useScheduledEvents.ts removed.
  • NostrFeed.vue repointed (or call sites removed if no longer needed).
  • SCHEDULED_EVENT_SERVICE DI token removed.
  • npm run build clean.
  • Task claim / start / complete / unclaim / delete flows work in both NostrFeed.vue and TaskList.vue (tasks standalone app).

Refs

  • Sibling cleanup issue: #78 (ReactionService dedup).
  • Cross-session log: ~/dev/coordination/log.md entry 2026-05-28T22:00Z (where the legacy-duplicate finding landed) and 2026-05-28T22:30Z (lnbits explicitly authorized opening this).
  • Design doc Q7.1: ~/dev/coordination/webapp-design-questions.md.
  • Parent initiative: aiolabs/lnbits#9 (signer abstraction / bunker integration).
## Summary `src/modules/nostr-feed/services/ScheduledEventService.ts` is a **legacy duplicate** of `src/modules/tasks/services/TaskService.ts`. The DI token is already marked deprecated and `FeedService` already routes incoming event handling to `TASK_SERVICE`, but the publish-side hasn't been deduped yet. This is the direct parallel to `#78` (ReactionService dedup) and blocks phase-2 bucket-B migration for the same reason: touching every `finalizeEvent` site twice or leaving dead-code paths that still try to read `prvkey`. ## Evidence - `src/core/di-container.ts:142-143`: ```ts /** @deprecated Use TASK_SERVICE instead */ SCHEDULED_EVENT_SERVICE: Symbol('scheduledEventService'), ``` - `src/modules/nostr-feed/services/FeedService.ts:75-77`: ```ts // ScheduledEventService moved to tasks module - use tryInjectService for backward compat this.scheduledEventService = tryInjectService(SERVICE_TOKENS.TASK_SERVICE) ``` - Both services define identical methods: `claimTask` / `startTask` / `completeEvent` / `unclaimTask` / `deleteTask` / `updateTaskStatus`. - Both publish ONLY kind 31925 (RSVP/status) and kind 5 (deletion). **Neither publishes kind 31922**; the only kind-31922 publish site is `ActivitiesNostrService.publishCalendarEvent` (bucket A; tracked by the broader `#9` migration). - Live callers today: - `ScheduledEventService` ← `nostr-feed/composables/useScheduledEvents` ← `nostr-feed/components/NostrFeed.vue` - `TaskService` ← `tasks/composables/useTasks` ← `tasks/components/TaskList.vue` Same domain, two callers, two implementations. ## Concrete proposal 1. Delete `src/modules/nostr-feed/services/ScheduledEventService.ts`. 2. Delete `src/modules/nostr-feed/composables/useScheduledEvents.ts`. 3. Repoint `src/modules/nostr-feed/components/NostrFeed.vue` from `useScheduledEvents` → `useTasks` (or eliminate the call site if the feed page is moving away from inline task interaction). 4. Remove the deprecated `SCHEDULED_EVENT_SERVICE` token from `src/core/di-container.ts`. 5. Audit `src/modules/nostr-feed/services/FeedService.ts:75-77` — the `tryInjectService(SERVICE_TOKENS.TASK_SERVICE)` aliasing-to-`this.scheduledEventService` field name is misleading post-deletion. Either rename the field or accept the rename as part of this cleanup. ## Why this matters now Blocker for phase-2 bucket-B migration per the `aiolabs/lnbits#9` signer-abstraction adoption. The migration touches every `finalizeEvent(eventTemplate, prvkeyBytes)` site; doing it on both copies wastes effort and risks one branch silently keeping the prvkey-read path alive. ## Acceptance - [ ] `nostr-feed/services/ScheduledEventService.ts` removed. - [ ] `nostr-feed/composables/useScheduledEvents.ts` removed. - [ ] `NostrFeed.vue` repointed (or call sites removed if no longer needed). - [ ] `SCHEDULED_EVENT_SERVICE` DI token removed. - [ ] `npm run build` clean. - [ ] Task claim / start / complete / unclaim / delete flows work in both `NostrFeed.vue` and `TaskList.vue` (tasks standalone app). ## Refs - Sibling cleanup issue: `#78` (ReactionService dedup). - Cross-session log: `~/dev/coordination/log.md` entry `2026-05-28T22:00Z` (where the legacy-duplicate finding landed) and `2026-05-28T22:30Z` (lnbits explicitly authorized opening this). - Design doc Q7.1: `~/dev/coordination/webapp-design-questions.md`. - Parent initiative: `aiolabs/lnbits#9` (signer abstraction / bunker integration).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/webapp#79
No description provided.