Repository navigation
Fix small follow-ups after the strict TypeScript port (TSF5) - #33
Merged
Merged
Conversation
- Sign-out reads only the cookie named exactly mini_session (shared sessionCookie). - An error thrown inside /auth/* gets the Worker's 503 answer (await handleAuth). - botDropText looks reasons up in a Map, so "constructor" reads as itself. - The demo overlay ignores postMessages without a demoPaused field. - The fighter page says a save may have gone through when a 2xx answer is unreadable (acceptedUnreadable). - port-check treats vite.config.ts as non-shipping, like vite.config.js. - Stale comments name vite.config.ts, src/admin.ts and tests/cosmetics.test.ts. - channel tests assert the alarm is set; the registry Twitch stub answers the moderators call.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Small fixes left over from the strict TypeScript port. This is a behavior PR, not a port PR: each behavior change has a test that failed before the fix and passes after it, plus a doc line.
Items
session()was already anchored. The real bug was/auth/logout, which matchedmini_session=anywhere in the header, soxmini_session=<hex>signed out the wrong session. Both now use onesessionCookie()in server/auth.ts.botDropTextprototype keysDROP_TEXTis aMap, soconstructorreads asconstructorinstead offunction Object() { [native code] } (constructor)./auth/*errors escape the Worker's catchreturn await handleAuth(...)inside the try, so a throwing AuthStore gets the 503Service unavailable; check owner diagnosticsanswer instead of a rejected fetch.parseDemoMessagereturnsnullfor a message without ademoPausedfield, and the overlay ignores it silently. AdemoPausedthat isn't a boolean still warns once.acceptedUnreadable(r)in src/parse.ts. The fighter page says "Your profile may have saved, but this page couldn't read the answer. Reload the page to check."?v=hash comment now names vite.config.tsservedBuild), upload.ts (vite.config.ts, src/admin.ts), cosmetics.ts (tests/cosmetics.test.ts). Comment-only changes to served code change the served hash once.NON_SHIPPINGmisses vite.config.tsvite.config.(js|ts), which matches what DEVELOPMENT.md and CONTRACTS.md already say.shape()specs exhaustive overT{ readonly [K in keyof T]-?: Check }spec fails tsc in two places (STATE_CONFIGis annotatedSpec, andLogRow.context?: unknownhas no check). Fixing it needs a new always-pass check in the page bundle, which is more than a few lines and changes how every spec is written.(alarm ?? 0) <= xis nowmust(alarm) <= xat five sites, so an unset alarm fails. The registry test's Twitch stub answers/helix/moderation/moderatorswith{data: []}explicitly. I confirmed the call is made: naming the viewer a mod there flips "a renamed Twitch name..."Red, then green
The pre-commit hook runs
bun run check, so the failing runs aren't in history. These are from the working tree before each fix.Unit (
bun run test:unit, before the fixes: 364 run, 360 pass, 4 fail):Item 4, the old
parseDemoMessageon messages an extension might post:Item 7, the new port-check test against the old
NON_SHIPPINGrule:Tests
acceptedUnreadable, item 5). Items 2 and 4 add assertions to existing tests in tests/worker.test.ts and tests/browser-parse.test.ts.bun run test:port, run by CI): 101 before, 102 after.acceptedUnreadableonly. The dashboard wiring has no automated test, and CI doesn't runtest:ui. I couldn't open a browser for this PR, so someone should check the message on staging.Docs
mini_sessioncounts, and/auth/*errors get the 503 answer. The bot status section says unknown drop reasons read as themselves. §8 coversparseDemoMessagereturning null andacceptedUnreadable./?channel=: the "may have saved" message.Follow-ups (not in this PR)
handle()in server/worker.ts has more unawaited returns inside the same try as item 3:return internal(...)(about 8 sites) andreturn refuseSave(...)(3 sites).internalcalls a Durable Object fetch that can reject. Turning on@typescript-eslint/return-awaitwithin-try-catchwould catch all of them.