The message-list handler correctly joins message_envelopes filtered to the caller's own deviceId but returns raw row objects instead of running them through the shared serializeMessage helper that GET /:id already uses. Callers can't distinguish "this device has no envelope for this message" from "this message legitimately has no content". There's no dedicated test file for this route.
Acceptance criteria:
- The handler maps each row through
serializeMessage, matching the shape GET /:id already produces
- Messages with no matching envelope for the caller's device are explicitly marked
unavailable: true
- A dedicated test file covers: normal pagination, an unavailable-envelope case, and cursor correctness
The message-list handler correctly joins
message_envelopesfiltered to the caller's owndeviceIdbut returns raw row objects instead of running them through the sharedserializeMessagehelper thatGET /:idalready uses. Callers can't distinguish "this device has no envelope for this message" from "this message legitimately has no content". There's no dedicated test file for this route.Acceptance criteria:
serializeMessage, matching the shapeGET /:idalready producesunavailable: true