docs: record message mutation parity checkpoint
This commit is contained in:
@@ -16,7 +16,7 @@ Build GoChat as a Go backend that can directly reuse the frontend from `referenc
|
||||
|
||||
## Current Baseline
|
||||
|
||||
- Latest implementation checkpoint: `9f89cbf feat(conversations): align chatwoot message serializers`.
|
||||
- Latest implementation checkpoint: `a465bbe feat(conversations): finish message mutation parity`.
|
||||
- Worktree status at this planning checkpoint: clean.
|
||||
- `go test ./...` passes.
|
||||
- Route dump succeeds with `TOTAL: 805` after Chatwoot root auth/session routes were added.
|
||||
@@ -72,12 +72,13 @@ This ledger records the committed parity checkpoints that future slices should b
|
||||
| `e59f9f3 feat(auth): add chatwoot session routes` | Added root `/auth/sign_in`, `/auth/validate_token`, `/auth/sign_out`, and `/auth/password` routes consumed by the reused Chatwoot frontend. Sign-in now emits DeviseTokenAuth-compatible `access-token`, `token-type`, `client`, `expiry`, and `uid` headers and returns raw `{ data: user }`; validate-token returns `{ payload: { success, data } }`. | Focused auth/profile tests passed; route dump regenerated with `TOTAL: 805`; route parity remained `251 exact, 0 missing`; escalated full `go test ./...` passed; `git diff --check` passed. | Continue B2 with profile settings update parity: `display_name`, `message_signature`, `ui_settings`, password update, and multipart avatar handling. |
|
||||
| `7aa3362 feat(profile): support chatwoot settings updates` | Completed profile settings update parity for `display_name`, `message_signature`, `ui_settings`, `phone_number` custom attributes, password changes with current-password verification, and multipart `profile[...]` FormData including avatar file input. | Focused profile tests passed; escalated full `go test ./...` passed; `git diff --check` passed. | B2 core auth/profile fixtures are complete enough to move next to conversations/messages serializer parity. |
|
||||
| `9f89cbf feat(conversations): align chatwoot message serializers` | Added Chatwoot conversation/message serializer boundary for dashboard list/show/filter, message index, message create/update/retry, status toggle payloads, display-id route resolution, outgoing/private message defaults, `echo_id`, `content_attributes`, and conversation/message parity migration fields. | Focused conversation/message handler tests passed; full `go test ./...` passed; `git diff --check` passed. | Continue B3 with delete/update status parity, multipart attachment create, team assignment response parity, and deeper message finder before moving to contacts/companies. |
|
||||
| `a465bbe feat(conversations): finish message mutation parity` | Finished the B3 mutation gap set: message delete now returns the Chatwoot deleted-message serializer and clears attachments; message status update supports `status`/`external_error` with API-inbox-only enforcement; `MessageFinder` now supports latest, `before`, `after`, and between windows; multipart `attachments[]` create attachment rows and serialize them in message payloads; team assignment returns the raw team payload. | Focused handler/service/repository tests passed; full `go test ./...` passed; `git diff --check` passed. | B3 core dashboard message flows move to review; continue with B4 contacts/companies while tracking deeper delivery/storage side effects. |
|
||||
|
||||
## Next Slice Contract
|
||||
|
||||
Completed implementation slice: B3 first checkpoint now returns Chatwoot dashboard-compatible conversation/message payloads for the core inbox flows.
|
||||
Completed implementation slice: B3 second checkpoint now returns Chatwoot dashboard-compatible conversation/message mutation payloads for the core inbox flows.
|
||||
|
||||
Next implementation slice: continue Q4/B3 conversations/messages behavior fixtures for remaining mutation and attachment gaps.
|
||||
Next implementation slice: start Q4/B4 contacts/companies behavior fixtures, while keeping B3 in review for delivery/storage side-effect parity.
|
||||
|
||||
| Step | Required result | Reference source | Verification |
|
||||
| --- | --- | --- | --- |
|
||||
@@ -105,8 +106,13 @@ Current B3 conversation/message checkpoint:
|
||||
- Message list now returns Chatwoot's `{ meta, payload }` shape with contact/assignee metadata and serialized messages matching `api/v1/models/_message.json.jbuilder` field names.
|
||||
- Message create accepts the reused frontend payload from `dashboard/api/inbox/message.js`, including omitted `message_type`, `private`, `echo_id`, JSON or multipart `content_attributes`, and defaults to outgoing text messages like Chatwoot's dashboard composer.
|
||||
- Message create/update/retry return raw Chatwoot message payloads with numeric `message_type` values expected by `shared/constants/messages.js`.
|
||||
- Message delete now follows `MessagesController#destroy`: it keeps the message row, changes content to `This message was deleted`, sets `content_attributes.deleted`, deletes message attachments, and returns the raw message serializer instead of `204`.
|
||||
- Message status updates now follow `Messages::StatusUpdateService` for `sent/delivered/read/failed`, preserve the read-to-delivered guard, record `external_error` only on failed messages, and reject status updates for non-API inboxes with `403`.
|
||||
- Message list now follows `MessageFinder` windows for latest, `before`, `after`, and between ranges, including `filter_internal_messages` handling.
|
||||
- Multipart `attachments[]` from Chatwoot's dashboard composer now create attachment rows and serialize Chatwoot-style attachment event data in message payloads.
|
||||
- Team assignment now follows `AssignmentsController#set_team` and renders the raw team payload when assigning by `team_id`.
|
||||
- Added migration `000018_add_conversation_message_parity_fields` for display-id routing and message serializer fields such as `echo_id`, `status`, and JSON attributes.
|
||||
- Remaining B3 gaps: message delete should return the deleted-message payload instead of `204`; API-inbox status update semantics need deeper parity; multipart attachment create currently only preserves form fields and still needs full attachment persistence; team assignment should render the team payload rather than conversation fallback; message finder pagination needs `before/after` behavior verification.
|
||||
- Remaining B3 review gaps: attachment persistence currently records metadata/URLs but does not yet provide ActiveStorage-equivalent durable binary storage; outbound delivery jobs and provider-specific attachment send behavior still need deeper Chatwoot side-effect parity; message realtime event payloads need frontend smoke validation.
|
||||
|
||||
## Immediate Execution Queue
|
||||
|
||||
@@ -158,7 +164,7 @@ Work proceeds top-down unless a failing test or frontend blocker forces a narrow
|
||||
| --- | --- | --- | --- | --- |
|
||||
| B1 | Webhook ingress route and handler parity. | `reference/chatwoot/config/routes.rb:614-624`, `reference/chatwoot/app/controllers/webhooks/*`, `reference/chatwoot/app/controllers/api/v1/webhooks_controller.rb` | Provider lookup tests, router route dump, `go test ./...`. | Done |
|
||||
| B2 | Auth/profile serializer fixtures. | `reference/chatwoot/app/controllers/api/v1/profile*`, frontend auth client. | Fixture tests for login/current user/profile/availability/settings. | Done |
|
||||
| B3 | Conversation/message serializer and behavior fixtures. | Chatwoot conversation/message controllers, entities, jobs. | Fixture tests for list/show/create/update/private notes/attachments/status/assignment. | Doing |
|
||||
| B3 | Conversation/message serializer and behavior fixtures. | Chatwoot conversation/message controllers, entities, jobs. | Fixture tests for list/show/create/update/private notes/attachments/status/assignment. | Review |
|
||||
| B4 | Contact/company behavior fixtures. | Chatwoot contact/company controllers, merge/import/export/notes/labels. | Fixture tests for CRUD/search/merge/relation/import-export shells. | Todo |
|
||||
| B5 | Inbox/channel behavior fixtures. | Chatwoot inbox/channel controllers and channel models. | Fixture tests for inbox CRUD, settings, business hours, members, avatar, channel config. | Todo |
|
||||
| B6 | Meilisearch live-shape review. | Chatwoot frontend search usage and search controllers. | Meilisearch-backed response fixtures plus optional live integration gate. | Todo |
|
||||
|
||||
Reference in New Issue
Block a user