Repository navigation
refactor: tidy the assistant transport and slim requestRaw - #565
Merged
Merged
Conversation
|
Automatic reviews are disabled for this repository. |
|
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.



Problem
requestRawinlib/api.tswas above Sonar's cognitive complexity limit (17 of 15). ARetry-Aftersent as an HTTP date parsed toNaN. The assistant stream left an abort listener on the caller's signal after the request settled. A few review leftovers in the chat hook had no test that would catch their removal, and the composer textarea was 2 px short of its content, which shows a scrollbar on Windows from the second line.Change
requestRaw: the 401 refresh-and-retry branch moves to a privaterefreshOrExpire(17 -> 10). Behaviour unchanged.parseRetryAfter: delta-seconds as before, an HTTP date becomes the seconds until it, anything else isundefined, so a date value no longer reaches the assistant asNaN.pending.catchis gone.assistant-chat:v1(sign-out still clears everyassistant-chat:key); one sharedisRecord; a redundant array check inloadMessagesand an extra write bump inrestoreDraftremoved (both covered by tests); expected refusals (404, 422, 429, 503) log as warnings, everything else as errors; tests that fail when either conversation-switch guard is removed.Verification
npm run lint,npm run typecheck,npm run test:coverage(thresholds held).eslint-plugin-sonarjs:requestRaw17 -> 10,send13 -> 10.Migrations
None.
Screenshots
None.