UI-SP5c — Tasks-list SSE follow-on (view-free)#24
Merged
Conversation
…ew-free template)
BLOCKER 1 (first-of-kind for this template): /api/v1/tasks/stream would be
shadowed by /{task_id} (FastAPI iterates routers in include order; "stream"
gets parsed as UUID → 422). SP5/SP5b didn't expose this because their stream
prefixes had no sibling parameterized routes. Fix: register
tasks_list_stream_router BEFORE tasks_router in main.py.
BLOCKER 2: cross-tenant test POSTs as user_id=2 but bootstrap only seeds
User(id=1) → FK violation. Fix: add User(id=2, tenant_id=2) to bootstrap.
IMPORTANT 1: cross-tenant test used storage_id=1 (tenant-1 storage) for the
tenant-2 task. Backend doesn't currently validate but test should be
semantically correct. Fix: parameterize _seed_tasks; pass storage_id=2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…outer to win /stream over /{task_id})
…hboard.vue unchanged)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third application of the view-free SSE template (after SP5 task-detail #22 and SP5b executors #23).
useTaskList(consumed by bothTaskList.vueand the Dashboard "recent tasks" widget) now talks SSE; both views unchanged.GET /api/v1/tasks/stream— hand-rolledtext/event-streammirroring SP5/SP5b. Reuses SP1'slist_tasksaggregation (tenant_filtered(select(DownloadTask))+total = count()). 5 s default tick clamp[0.5, 60.0]. Same?max_ticks=Ntestability hatch.useTaskListopts in via the SP5-shippedstreamUrl+applyEventseam — signature/return unchanged.TaskList.vue+Dashboard.vueNOT modified.Pre-review found 2 real BLOCKERs (first-of-kind for this template)
/api/v1/tasks/streamlives in a separate router with the same/api/v1/tasksprefix astasks_router(which has/{task_id}). FastAPI iterates routers in include order — iftasks_routercame first,GET /tasks/streamwould match/{task_id}→ 422 UUID parse. SP5/SP5b didn't expose this because their stream paths had no sibling parameterized routes under the same prefix. Fix: registertasks_list_stream_routerBEFOREtasks_routerinsrc/dlw/main.py+ comment explaining the invariant.User(id=2)seed: cross-tenant test POSTs asuser_id=2; bootstrap previously only seededUser(id=1)→ FK violation. Fix: bootstrap seeds both.A third IMPORTANT was also fixed (cross-tenant test used
storage_id=1for the tenant-2 task; now usesstorage_id=2).These three pre-review catches reinforce the value of the 2-opus gate — even on what looked like a near-trivial template repeat.
Verification
--max-warnings=0; vite build ok. spectral/swagger/invariant/status-write all green./api/v1/tasks/streamSSE request observed in DevTools network on the/taskspage; zero real console errors.git diff af48a0a..HEAD -- frontend/src/pages/TaskList.vue frontend/src/pages/Dashboard.vuereturns empty._KEEPALIVE_EVERY_TICKSvestige).Test plan
🤖 Generated with Claude Code