1.9 KiB
1.9 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| message-queue-merge-02 | Backend service and WS handler | completed | 2 |
|
plan.md | ../../specs/ui/message-queue-merge.md |
Task 02: Backend service and WS handler
Acceptance
ActionMessageQueueMerge = "message.queue.merge"exists inpkg/websocket/actions.goandService.MergeIntoAbovedelegates to the repository (with the same logger pattern asRemoveEntry).QueueHandlersregistersmessage.queue.merge, validatessession_id/entry_id, rejects reserveduser_id, defaultsuser_idtoQueuedByUser, and mapsErrEntryNotFound→entry_not_found/ErrNoMergeTarget→ validation, publishingmessage.queue.status_changedon success.- Handler tests cover the happy path, missing fields, head/mismatch → validation,
reserved
user_idrejection, and drained source →entry_not_found.
Verification
cd apps/backend && go test -race ./internal/orchestrator/handlers/... ./internal/orchestrator/messagequeue/...
Files
apps/backend/pkg/websocket/actions.goapps/backend/internal/orchestrator/messagequeue/service.goapps/backend/internal/orchestrator/handlers/queue_handlers.goapps/backend/internal/orchestrator/handlers/queue_handlers_merge_test.goapps/backend/internal/orchestrator/messagequeue/service_test.go
Inputs
- Spec sections:
API surface,Failure modes,Permissions. - Plan sections:
Backend → Contract,Backend → WS handler,Tests(service- handler rows).
- Patterns to mirror:
wsUpdateMessagevalidation/error mapping (queue_handlers.go:243),wsRemoveEntryshape (queue_handlers.go:332),publishStatus.
Risks
- Any other
QueueServiceimplementor in the codebase must gain the newMergeIntoAbovemethod — grep forQueueServiceimplementations (e.g. mocks in tests) and update them.