35 lines
1.9 KiB
Markdown
35 lines
1.9 KiB
Markdown
# Task 1 Report: Chat deletion and browser transport errors
|
|
|
|
## Implementation
|
|
|
|
- Added the owner-only `chat_sessions` DELETE policy and authenticated DELETE grant.
|
|
- Classified both native `SyntaxError` and WebKit `DOMException` values named `SyntaxError` as JSON parse/lost-response errors.
|
|
- Non-OK responses with malformed JSON now return `payload: null`; retry logic recognizes the WebKit error form.
|
|
|
|
## Files
|
|
|
|
- `frontend/supabase/migrations/20260720000000_chat_delete_and_dynamic_candidate_confirmation.sql`
|
|
- `frontend/tests/chat-session-delete-contract.test.ts`
|
|
- `frontend/tests/birth-time-client-transport.test.ts`
|
|
- `frontend/src/lib/birth-time-client-transport.ts`
|
|
|
|
## TDD evidence
|
|
|
|
- RED: `node --import ./frontend/node_modules/tsx/dist/loader.mjs --test frontend/tests/chat-session-delete-contract.test.ts frontend/tests/birth-time-client-transport.test.ts` failed as expected: the migration file was absent and `DOMException("SyntaxError")` escaped; the native non-JSON case already passed.
|
|
- GREEN: the same command passed all 3 tests after the minimal implementation.
|
|
|
|
## Verification
|
|
|
|
- Focused suite: 3 passed, 0 failed.
|
|
- Full frontend suite: `node --import ./frontend/node_modules/tsx/dist/loader.mjs --test frontend/tests/*.test.ts` completed with 461 passed and 1 failed (462 total).
|
|
- The sole failure is the known baseline in `frontend/tests/health-deployment.test.ts`: its expected `DEPLOY_GIT_SHA` expression differs from the existing deployment workflow. It is outside Task 1 scope.
|
|
- Self-review: inspected the migration against existing owner-scoped RLS patterns, reviewed the four-file diff, and ran `git diff --check` successfully.
|
|
|
|
## Commit
|
|
|
|
- Implementation: `4ffebdd fix: close chat deletion and transport errors`
|
|
|
|
## Concerns
|
|
|
|
- The repository pre-work gate remains blocked by its documented host Python 3.9/fragment-scan baseline; it did not affect this frontend-only task.
|