[Bounty Proposal] fix(backend): one malformed stored message 500s the desktop journal reconcile page ($25-50 proposed)
Summary
GET /v2/desktop/messages/reconcile (the desktop journal sync page) returns raw Firestore dicts into DesktopMessageReconcilePageResponse.messages: list[Message]. Message requires id/text/created_at/sender/type, and get_messages_reconcile_page only filters the reported flag — so one legacy or corrupted stored row makes FastAPI raise ResponseValidationError (HTTP 500) and the desktop client cannot sync its journal until the document is fixed manually.
The sibling endpoint GET /v2/desktop/messages was already hardened against exactly this failure class with Message.deserialize_many_safe; the reconcile path was missed.
Fix
Route the reconcile page through the same guard in backend/routers/chat_sessions.py: malformed rows are skipped and logged non-PII (record id + exception class), valid rows are returned, and next_cursor/has_more pass through untouched so the client can resume the scan even when a page contains only poisoned rows.
Tests
backend/tests/unit/test_desktop_messages_reconcile_poison.py — 9 hermetic unit tests (no network, no services): malformed / missing-text / garbage-typed / non-dict rows are dropped, all-valid pages survive unchanged, pagination fields pass through, next_cursor survives an all-poisoned page, skips are logged, and a structural check keeps both desktop message surfaces on the same deserializer.
Proposed Bounty
- $25–50 (read-boundary poison-page hardening; same failure class as the earlier desktop-messages guard).
Payout (PayPal): [email protected]
Disclosure: investigation, patch, and tests were prepared with an AI assistant. This proposal does not represent independent human technical review.