Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function sendChat(text) { | ||
| const state = window.haloState; | ||
| if (!state.online.enabled || !text) return; | ||
| sendRelay({ type: "chat", from: state.profile.pilot || "anon", text }); | ||
| state.online.log.push({ sender: state.profile.pilot || "me", message: text }); |
There was a problem hiding this comment.
Relay chat payload uses mismatched field name
sendChat publishes chat messages with a text field and renders incoming chat from msg.text, but the relay server introduced in this commit forwards chat using message (scripts/server.js lines 56‑57). With online mode enabled, peers will receive packets where message is undefined, so inbound chat never appears for other clients. Aligning the field names on either side is needed for chat to work.
Useful? React with 👍 / 👎.
| function syncDepth() { | ||
| const state = window.haloState; | ||
| if (!state.run) return; | ||
| sendRelay({ type: "sync", depth: state.run.depth, seed: state.profile.seed }); | ||
| } |
There was a problem hiding this comment.
Run depth sync never reaches peers
syncDepth emits { type: 'sync', depth, seed }, while the relay server rebroadcasts payload: data.payload (scripts/server.js 51‑53) and the client later reads msg.depth when handling sync messages. Because depth is nested under neither payload nor depth in the broadcast, other clients never receive the run depth, so multiplayer syncing is effectively broken whenever the relay is used.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task