Found by the payload-key sweep required by #46 (see PR #75).
Symptom
Views/EditMessageView.swift lets the user edit a post's text and save. Nothing changes.
- Editing an already-published post fails with
400 "Can only edit scheduled posts that are in the future" — copy that makes no sense in an edit sheet.
- Editing a future scheduled post returns
200 and the content change is silently discarded.
Root cause
APIClient.editMessage(id:content:publiclyVisible:) (Services/APIClient.swift:381-388) sends
PATCH /api/messages/{id} { content, publiclyVisible }
But app/api/messages/[id]/route.ts PATCH is "reschedule a scheduled post":
:127 — if (!message.scheduledAt || message.scheduledAt <= new Date()) return badRequest('Can only edit scheduled posts that are in the future')
:132 — const { scheduledAt: scheduledAtRaw, scheduledCrossPostConfig } = body
content and publiclyVisible are never read. The route exports only GET, PATCH, DELETE.
This is a backend gap, not just an iOS bug
There is no route anywhere that updates a message's content — grep content app/api/messages/**/route.ts
matches only the create path (POST /api/messages) and the metadata routes. The web ships no edit
surface either (grep -rln "isEditing|handleEdit|editMessage" components/messages/ → nothing).
So iOS shipped an edit feature the platform does not have.
Options
- Backend ask — add
PUT /api/messages/{id} (or extend PATCH) accepting { content, publiclyVisible } for the author, with an editedAt marker, authorized via
getCurrentUserOrSyncToken. Then iOS points editMessage at it.
- Or remove
EditMessageView and editMessage from iOS until the platform supports editing.
Needs a product call on which. Until then the sheet should not be reachable — it can only fail.
Acceptance criteria
Files: Services/APIClient.swift:381, Views/EditMessageView.swift; backend
app/api/messages/[id]/route.ts.
Found by the payload-key sweep required by #46 (see PR #75).
Symptom
Views/EditMessageView.swiftlets the user edit a post's text and save. Nothing changes.400 "Can only edit scheduled posts that are in the future"— copy that makes no sense in an edit sheet.200and the content change is silently discarded.Root cause
APIClient.editMessage(id:content:publiclyVisible:)(Services/APIClient.swift:381-388) sendsBut
app/api/messages/[id]/route.tsPATCHis "reschedule a scheduled post"::127—if (!message.scheduledAt || message.scheduledAt <= new Date()) return badRequest('Can only edit scheduled posts that are in the future'):132—const { scheduledAt: scheduledAtRaw, scheduledCrossPostConfig } = bodycontentandpubliclyVisibleare never read. The route exports onlyGET,PATCH,DELETE.This is a backend gap, not just an iOS bug
There is no route anywhere that updates a message's content —
grep content app/api/messages/**/route.tsmatches only the create path (
POST /api/messages) and the metadata routes. The web ships no editsurface either (
grep -rln "isEditing|handleEdit|editMessage" components/messages/→ nothing).So iOS shipped an edit feature the platform does not have.
Options
PUT /api/messages/{id}(or extendPATCH) accepting{ content, publiclyVisible }for the author, with aneditedAtmarker, authorized viagetCurrentUserOrSyncToken. Then iOS pointseditMessageat it.EditMessageViewandeditMessagefrom iOS until the platform supports editing.Needs a product call on which. Until then the sheet should not be reachable — it can only fail.
Acceptance criteria
Files:
Services/APIClient.swift:381,Views/EditMessageView.swift; backendapp/api/messages/[id]/route.ts.