Skip to content

Fix transport review findings - #7129

Merged
matthewevans merged 3 commits into
mainfrom
fix/sandbox-review-followup
Aug 9, 2026
Merged

Fix transport review findings#7129
matthewevans merged 3 commits into
mainfrom
fix/sandbox-review-followup

Conversation

@matthewevans

@matthewevans matthewevans commented Aug 9, 2026

Copy link
Copy Markdown
Member

Follow-up to #7128 after it merged.

  • surface completed-scry notifications for remote state updates
  • preserve per-connection ordering for ActionNoOp acknowledgements

Summary by CodeRabbit

  • New Features
    • Added immediate in-game visual flashes for remote dice rolls and completed scry actions, before related event animations begin.
    • Completed scry actions now display all applicable outcomes.
  • Bug Fixes
    • Improved handling of game action updates to ensure debug and no-op responses are delivered consistently during gameplay.

@matthewevans
matthewevans enabled auto-merge August 9, 2026 12:11
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@matthewevans, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d140f6d-55bb-4976-9bd5-027b59ab70e7

📥 Commits

Reviewing files that changed from the base of the PR and between 4e6331d and c3c2ed8.

📒 Files selected for processing (2)
  • client/src/game/__tests__/diceContest.test.ts
  • client/src/stores/uiStore.ts
📝 Walkthrough

Walkthrough

The client now displays remote roll and all completed-scry outcomes independently of animation processing. The server prioritizes queued outbound messages and routes zero-count debug-create responses through the connection sender.

Changes

Remote event handling

Layer / File(s) Summary
Remote roll and scry flashes
client/src/game/dispatch.ts, client/src/game/diceContest.ts
Remote dispatch triggers roll and completed-scry flashes before animation normalization. flashCompletedScry now displays every matching completed-scry outcome and removes unused type aliases.
Outbound submission responses
crates/phase-server/src/main.rs
The WebSocket loop prioritizes queued outbound messages. Action and interaction dispatch pass the sender to handle_full_game_submission, which queues zero-count debug-create ActionNoOp responses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • phase-rs/phase#6549: Updates related roll and scry outcome handling in client/src/game/diceContest.ts.
  • phase-rs/phase#7123: Updates related completed-scry handling in client/src/game/diceContest.ts.
  • phase-rs/phase#7128: Introduces related dispatch, scry flash, and server no-op routing changes.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the pull request as fixes for transport-related review findings, including notification and message-ordering changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sandbox-review-followup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/game/dispatch.ts`:
- Around line 840-841: Update flashCompletedScry and its call site in the
dispatch flow to process every completed Scry event in events rather than only
the first match returned by find. Preserve the existing notification behavior
for each matching event, including repeated or simultaneous Scry actions in one
batch.

In `@crates/phase-server/src/main.rs`:
- Around line 3868-3869: Update the tokio::select! handling the ActionNoOp path
to use biased selection so the queued outbound response is drained before
reading another socket frame, and ensure all responses use the same serialized
writer. Add a wiring test covering zero-count debug-create followed by a
direct-response message, verifying wire order.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 48210804-a6be-4537-8e15-adc66fb4e401

📥 Commits

Reviewing files that changed from the base of the PR and between 7b17f21 and ae21354.

📒 Files selected for processing (2)
  • client/src/game/dispatch.ts
  • crates/phase-server/src/main.rs

Comment thread client/src/game/dispatch.ts
Comment thread crates/phase-server/src/main.rs
@matthewevans
matthewevans added this pull request to the merge queue Aug 9, 2026
@matthewevans
matthewevans removed this pull request from the merge queue due to a manual request Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/src/game/diceContest.ts`:
- Around line 94-98: Update the completed-Scry notification flow around
flashScryOutcome so multiple outcomes from one event batch are queued and
displayed FIFO rather than replacing the active scryOutcome or resetting its
timer. Preserve event order, and add a regression test covering two completed
Scry events.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 793cea5e-9a19-4ee0-abcd-3001d0c0ede5

📥 Commits

Reviewing files that changed from the base of the PR and between ae21354 and 4e6331d.

📒 Files selected for processing (2)
  • client/src/game/diceContest.ts
  • crates/phase-server/src/main.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/phase-server/src/main.rs

Comment on lines +94 to +98
useUiStore.getState().flashScryOutcome({
playerId: scry.data.player_id,
topCount: scry.data.scry_top_count,
bottomCount: scry.data.scry_bottom_count,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

fd -i -t f 'uiStore\.ts$' client | while IFS= read -r file; do
  rg -n -A8 -B4 'flashScryOutcome|scryOutcomeTimer|scryOutcome' "$file"
done

Repository: phase-rs/phase

Length of output: 4287


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== candidate files =="
fd -i -t f 'diceContest\.ts$|uiStore\.ts$' client

echo
echo "== diceContest relevant section =="
file="$(fd -i -t f 'diceContest\.ts$' client | head -n 1)"
if [ -n "${file:-}" ]; then
  wc -l "$file"
  sed -n '70,115p' "$file" | cat -n
fi

echo
echo "== all scryOutcome flash usages =="
rg -n "flashScryOutcome|resetScryOutcome|scryOutcome" client --glob '!**/*.snap'

echo
echo "== package/test availability =="
git ls-files client | awk 'tolower($0) ~/test|\.test\./ || /scry/i' | sort -u | head -n 80

Repository: phase-rs/phase

Length of output: 8359


Queue completed-scry outcomes instead of replacing the active notice.

When one event batch contains multiple completed Scry actions, this code calls flashScryOutcome for each action. The UI store has one scryOutcome, and each call replaces the previous payload and resets its timer. Therefore, only the last outcome remains visible.

Make the notification path FIFO, or add a batch API that displays every outcome in event order. Add a regression test with two completed Scry events.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@client/src/game/diceContest.ts` around lines 94 - 98, Update the
completed-Scry notification flow around flashScryOutcome so multiple outcomes
from one event batch are queued and displayed FIFO rather than replacing the
active scryOutcome or resetting its timer. Preserve event order, and add a
regression test covering two completed Scry events.

Source: Path instructions

@matthewevans
matthewevans added this pull request to the merge queue Aug 9, 2026
@matthewevans
matthewevans removed this pull request from the merge queue due to a manual request Aug 9, 2026
@matthewevans
matthewevans added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 4179516 Aug 9, 2026
13 checks passed
@matthewevans
matthewevans deleted the fix/sandbox-review-followup branch August 9, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant