Repository navigation
fix(id/web): validate upload/compile socket frame fields (#7928) - #8511
Merged
Merged
Conversation
Present-but-non-string message/module_hash/diagnostics in the upload and compile handlers now take the existing invalid-response path (invalid status, socket close, admin token preserved) instead of being coerced into the UI or treated as success. 9 behavioral tests cover malformed and well-formed frames for both sockets.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
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. |
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.
What
Validates the world upload/compile socket frame fields before they are rendered or acted on (#7928). Both handlers in
pkgs/id/web/src/world.tscheckedisRecord+ stringtype(andupload_ready's chunk_bytes) but then cast to WorldFrame and usedmessage/module_hash/diagnosticsunchecked: an object message rendered[object Object], an array messagea,b, an object/numeric module_hash rendered as a bogus success hash, and a bogus module_installed/compiled frame still cleared the admin token.hasNonStringFieldguard besideisRecordin world.ts: a present-but-non-string value (object, array, number, null) for a field the frame type uses makes the frame an invalid response for that handler.error.message,module_installed.module_hash.error.message,compiled.module_hash+compiled.diagnostics.Tests
New
world-upload-compile.test.ts(9 tests, world-records harness pattern — real page markup from templates.rs, FakeWebSocket): malformed object/array/numeric cases for both sockets assert the invalid status, socket close, and the admin token surviving; well-formed error/module_installed/compiled frames assert unchanged behavior.bunx vitest run src/world-upload-compile.test.ts src/world-records.test.ts— 15 passed.bunx tsc --noEmit— clean.Refs #7928.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.