Skip to content

test(net): wait for the widened range's SUBSCRIBE_UPDATE before checking the feed is pending - #9147

Merged
kixelated merged 1 commit into
mainfrom
fix/lite07-widened-started
Nov 19, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/lite07-widened-started

Conversation

@kixelated

@kixelated kixelated commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On main, the @moq/net test "a widened range's SUBSCRIBE_STARTED resolves the feed's start" fails at its "pending after the update" check (Expected: "pending", Received: 0n). It passes on the commit before moq-dev/moq#9045 and fails from it on. The merge gate selects tests by changed path, so it landed unnoticed, and any PR touching js/net hits it.

This fixes the planned lite07-widened-started follow-up from moq-dev/moq#9132.

Approach

The open question was whether #9045 stopped owing a widened range its own SUBSCRIBE_STARTED (fix the code) or only changed timing (fix the test). Recommendation: fix the test. Evidence:

The test now reads the SUBSCRIBE_UPDATE off the request stream, which the loop writes only after the declaration, instead of draining reactions a fixed number of times. It also asserts what the old comment only claimed: the update retires Range ID 0 and adds one range, which takes ID 1.

Validation

  • Reproduced on main: fails at subscriber.test.ts:2868 with Received: 0n.
  • With five drains instead of one (scratch, not committed), the old test passes, which shows the behavior is intact and only the timing moved.
  • Fixed test passes. Mutation check: removing the update path's this.#declare(entry) makes it fail with Received: 0n, so it still guards the declaration.
  • bun test src/lite/: 901 pass, 0 fail. just check and just ci pass.

Impact

None. Test-only; no public API or wire change.

Alternatives

Follow-ups

None.

Caused by

  • moq-dev/moq#9045 - added an async field measurement before the lite-07 update's declaration and left this test draining once (found by check, the test failing while working on moq-dev/moq#9132)

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, high effort

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high)

Review

Rewritten by quest review after each round.

  • Head: bea4869

  • Base: origin/main at a245f60

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1f15a-28ce-7f80-a6e2-46b24f6db44a, round 1

  • Score: 10/10, The narrowly scoped synchronization fix waits for SUBSCRIBE_UPDATE and verifies the retired range and replacement; source inspection found no actionable regression, and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

…ing the feed is pending

The lite-07 update loop now measures the SUBSCRIBE's fields (an async
encode) before it edits the ranges and declares the feed pending, so one
reaction drain no longer reaches the declaration. Read the update off the
request stream instead: it is written only after the declaration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 19, 2026 01:10
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff6aa1ad-6c0e-4545-866f-d7a082a387fb
Commits

Reviewing files that changed from the base of the PR and between a245f60 and bea4869.

Files selected for processing: 1

  • js/net/src/lite/subscriber.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@kixelated
kixelated enabled auto-merge November 19, 2026 01:11

@pullfrog pullfrog 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.

✅ No new issues found.

Approach: sound. The test reads the SUBSCRIBE_UPDATE off the request stream, which the update loop writes only after declaring the feed pending. That replaces a fixed number of reaction drains.

Reviewed changes

I reviewed the whole one-file diff in js/net/src/lite/subscriber.test.ts, and checked the helpers it uses against the test file and subscribe.ts.

  • Deterministic wait: the test builds a Reader over request.outbound, consumes the StreamId.Subscribe header and the Subscribe message, then awaits SubscribeUpdate.decode. This follows the existing pattern near line 1364.
  • Stronger assertions: it now checks update.remove is [0n] and update.ranges has length 1. The old comment only claimed this.
  • Imports: Reader, StreamId, Subscribe and SubscribeUpdate are all already imported, and SubscribeUpdate.remove exists.

I did not run the tests.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit d821733 Nov 19, 2026
7 checks passed
@kixelated
kixelated deleted the fix/lite07-widened-started branch November 19, 2026 01:38
riedlse pushed a commit to riedlse/moq that referenced this pull request Nov 19, 2026
…oq-dev#9160)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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