Skip to content

fix(crm): return valid record update responses - #60

Merged
debpalash merged 1 commit into
debpalash:mainfrom
rudycelekli:fix/crm-missing-update-not-found-20261006
Oct 7, 2026
Merged

debpalash merged 1 commit into
debpalash:mainfrom
rudycelekli:fix/crm-missing-update-not-found-20261006

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

What changed

  • Return a real HTTP 404 when a CRM update targets a missing record. Returning a (dict, 404) tuple failed FastAPI's response_model=dict validation and produced HTTP 500.
  • Serialize persisted column values for successful updates. Returning the ORM object's raw __dict__ included SQLAlchemy InstanceState, so ordinary updates committed but then returned HTTP 500.

Verified

Ran the public PATCH /api/data/{id} route through FastAPI with a real SQLite database and an operator fixture. No CRM/provider requests were mocked or sent by these new route regressions.

Upstream main This branch
Missing record: HTTP 500. HTTP 404 with Record with id 999 not found; existing records unchanged.
Existing record: changes commit, then response serialization fails with HTTP 500. HTTP 200 with the persisted notes, used flag and unchanged name; a fresh database read confirms the update.
  • Focused CRM route/import suite: 20 passed.
  • Frozen backend selection: 1,880 passed, 131 skipped, 3 deselected, 3 deprecation warnings. No production or user database was used.
  • PostgreSQL service tests were not run locally; hosted checks remain pending. No frontend source changed, and no frontend build is claimed.
  • Screened current open PR files for overlap; no other open PR changes this handler or these new regression tests. Authentication and workspace behavior are unchanged.

AI assistance: implemented and tested with Codex on behalf of Rudy Celekli. The exact signed DCO patch received a separate source review before publication.

Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
@rudycelekli
rudycelekli requested a review from debpalash as a code owner October 6, 2026 15:54
@debpalash
debpalash merged commit 0399c3a into debpalash:main Oct 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants