fix(desktop): conversation title edit hits nonexistent endpoint, never saves#7484
Conversation
PATCH /v1/conversations/{id}/title?title=... matches the Python backend
route (conversations.py:177) and the Flutter client (conversations.dart:146).
The previous call to PATCH /v1/conversations/{id} with a JSON body hit a
nonexistent route, returned 404, and silently discarded the edit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR fixes a silent failure when editing a conversation title in the macOS desktop app by correcting the API call to match the actual backend contract and the existing Flutter mobile client.
Confidence Score: 5/5Minimal, targeted fix that aligns the desktop client with the documented backend route — safe to merge. The change is a two-line correction: the URL path gains No files require special attention; both changed files are straightforward. Important Files Changed
Sequence DiagramsequenceDiagram
participant Desktop as macOS Desktop App
participant API as APIClient.swift
participant Backend as Python Backend
note over Desktop,Backend: Before fix (broken)
Desktop->>API: updateConversationTitle(id, title)
API->>Backend: "PATCH /v1/conversations/{id} Body: {"title": "..."}"
Backend-->>API: 404 Not Found (no such route)
API-->>Desktop: throws APIError.httpError(404)
note over Desktop: Title silently lost
note over Desktop,Backend: After fix (working)
Desktop->>API: updateConversationTitle(id, title)
API->>Backend: "PATCH /v1/conversations/{id}/title?title=..."
Backend-->>API: 200 OK
API-->>Desktop: success — title persists
Reviews (1): Last reviewed commit: "desktop: changelog - conversation title ..." | Re-trigger Greptile |
| let url = components.url! | ||
| var request = URLRequest(url: url) | ||
| request.httpMethod = "PATCH" | ||
| request.allHTTPHeaderFields = try await buildHeaders(requireAuth: true) |
There was a problem hiding this comment.
Content-Type: application/json on a body-less PATCH
buildHeaders always injects "Content-Type": "application/json", but this request no longer sends a body. Sending Content-Type: application/json with an empty body is technically incorrect and could confuse proxies or strict middleware. This pattern is already widespread in APIClient.swift (e.g., the starred PATCH on line 327), so it's a pre-existing issue not introduced here, but worth noting while the endpoint contract is being corrected.
Problem
Editing a conversation title in the macOS desktop app silently fails and the title never persists. The same edit on mobile works.
Root cause
APIClient.updateConversationTitlesentPATCH /v1/conversations/{id}with the title in a JSON body. The Python backend has no such route. The only title route isPATCH /v1/conversations/{id}/titlewith the title as a query param (backend/routers/conversations.py:177), which the Flutter app already calls (app/lib/backend/http/api/conversations.dart:146). The desktop request 404s, the guard throwsAPIError.httpError, and the edit is lost.Fix
Point the desktop call at
/v1/conversations/{id}/titlewith the title as a query item, matching the backend contract and the mobile client. UsesURLComponentsso the title is percent-encoded. Removes the unusedTitleUpdatebody struct.Testing
Edited a conversation title in the desktop app and confirmed it persists across a refresh.