Repository navigation
Conversation
Split out of #6 (retrofit networking layer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Closed
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.
@caleb-bit, could you review? Stack 2/5. This is the core of the stack and the one to spend the most time on.
The shared networking client, plus users and houses.
RetrofitInstance: one OkHttp/Retrofit client. It addsAuthorization: Bearer, and on a 401 refreshes the token and retries once. It won't retry if (a) the request went to a different origin, or (b) the signed-in account changed since the request started (session number carried on an OkHttp request tag). Only earlier 401s count toward "once", so a redirect before the 401 doesn't block the refresh.TokenProvider/DevTokenProvider:dev:<netid>tokens for the local backend until Google sign-in existsRoomieApiResponse: Pending / Success / Error.apiCall {}turns HTTP, network and parse failures intoApiErrors using the backend'serrorCodeand field errorsResponseFlow<T>: the state holder every repository uses. Only the latest fetch publishes;set()cancels and discards a fetch in flight;update()is serializedAuthRepository,HouseRepository,UserApiService,HouseApiService, and shared DTOs (including the newpresenceHOME/AWAY field)This includes fixes for CodeRabbit's review of #6: authenticator retry rules, account switch during a retry,
leaveHouseracingfetchHouse, and an older fetch overwriting a newer one.Test: passes 28/28. New:
RoomieApiTest(retry once, give up on the second 401, redirect then 401, no retry after an account switch, error parsing, network failure) andResponseFlowTest.Part of a 5-PR stack that replaces #6 (split so each piece is reviewable on its own). Merge in order; each PR targets the one before it.
🤖 Generated with Claude Code