Prerelease: 3 verified fixes — 500s, 401 retry, Firestore cache (#5441 #5442 #5443)#5459
Merged
Prerelease: 3 verified fixes — 500s, 401 retry, Firestore cache (#5441 #5442 #5443)#5459
Conversation
Legacy Firestore person documents may lack these fields, causing ResponseValidationError (500) on /v1/users/people for 8 users. Make both fields Optional with None default. Fixes part of #5423 Co-Authored-By: Claude Opus 4.6 <[email protected]>
get_people(), get_person(), get_person_by_name(), get_people_by_ids() all returned raw to_dict() without the document ID. Legacy docs missing the 'id' field caused ResponseValidationError on Person model. Fixes #5423 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Enables the list endpoint to use this lighter function that skips loading full base64 photo content per conversation. Fixes part of #5424 Co-Authored-By: Claude Opus 4.6 <[email protected]>
GET /v1/conversations was loading full base64 photos for every conversation via @with_photos decorator. 50 convos x 1.2MB = 57MB exceeded Cloud Run 32MB response limit. The list endpoint doesn't need photo content — individual conversation GET still loads them. Fixes #5424 Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ingApiCall Port the 401→refresh→retry→signout pattern from makeApiCall() into both multipart methods. Extract _buildMultipartRequest() helper to rebuild requests for retry (streams are single-use). Fixes #5414
Reviewer feedback: where("id", "in", ...) misses legacy docs that
don't have a stored 'id' field. Use db.get_all() with doc refs instead.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
10 tests covering: - Person model resilience with missing created_at/updated_at (#5423) - Doc ID injection in get_people, get_person, get_people_by_ids (#5423) - Conversations list endpoint uses without-photos function (#5424) - get_conversations_without_photos supports folder_id/starred (#5424) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Large batch test for get_people_by_ids (>30 IDs, old where-in limit) - Empty list boundary test - Verify get_conversations_without_photos lacks @with_photos decorator - Verify get_conversations retains @with_photos for individual use Co-Authored-By: Claude Opus 4.6 <[email protected]>
7 tests covering all code paths: - Non-401 returns directly (no refresh, no signout) - 401 → refresh succeeds → retry succeeds (200) - 401 → refresh succeeds → retry still 401 → signs out - 401 → refresh fails (empty token) → signs out without retry - requireAuthCheck=false skips 401 handling - Request rebuilt with fresh headers for retry - 500 does not trigger auth retry
… retry test Adds STAGING_API_URL= to generated .dev.env (fixes pre-existing envied compilation failure that blocked all tests on clean checkout).
Per kelvin UAT review: callers must not assume result order matches input person_ids order. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Resolved test.sh conflict: include both test files.
Collaborator
Author
|
lgtm |
Contributor
Greptile SummaryThis prerelease combines three independently verified fixes targeting active 500 errors, a 401 token-refresh gap for multipart API calls, and Firestore read cost reduction via in-process caching. Key changes:
All production logic changes are straightforward, well-tested (72/72 unit tests), and verified with live API + physical device E2E. Confidence Score: 4/5
Last reviewed commit: cc5df0b |
This was referenced Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prerelease branch combining 3 independently verified sub-PRs:
/v1/users/peopleand/v1/conversations500 errors (@yuki)Verification
All 3 PRs passed comprehensive verification in PR #5445 by @Kelvin:
test.shconflict resolved — both test lines included)Deploy Request
Please trigger backend deploy after merge — these fixes address active 500 errors and cost optimization. Deploy via "Deploy Backend to Cloud RUN" workflow (covers Cloud Run + GKE backend-listen rollout restart).
Merge Strategy
Each sub-PR was merged with
--no-ffto preserve individual commit history.