Skip to content

test(relay): cover grant expiry before SETUP - #6857

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/auth/expire-before-setup
Oct 27, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/auth/expire-before-setup

Conversation

@kixelated

@kixelated kixelated commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A grant can expire after admission but before SETUP. The relay already distinguishes expiry from other refusals, but the pre-SETUP tests did not verify that distinction.

Approach

Extend the pre-SETUP refusal helper to check the expected relay error and the client's decoded session close. Add a manual-clock expiry case and retain invalid-label coverage and failed-session accounting.

Impact

  • No public API or wire changes. Tests cover the existing Expired session close (0x18).

Alternatives

Reuse the existing transport harness instead of adding a separate setup fixture.

Follow-ups

None. Completes quest/m1/auth/expire-before-setup.md.

Validation

  • The earlier config.websocket feature-shape blocker was fixed on main by moq-dev/moq#6830 (moq-dev/moq#6856 closed as superseded). Merged origin/main, resolving a quest/m1/auth/README.md conflict by dropping both finished quests (expire-before-setup, and drain-token from moq-dev/moq#6859).
  • Passed just check after the merge: 669 tests, 25 skipped, including both pre-SETUP refusal cases; quest check clean.
  • No wire or moq-ffi change, so interop was not rerun.

(Written by GPT-6, updated by Claude Opus 5.5)

@kixelated kixelated changed the title A grant that expires before SETUP test(relay): cover grant expiry before SETUP Oct 26, 2026
kixelated and others added 2 commits October 25, 2026 22:53
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 26, 2026 22:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T22:35:30.140525Z d1e8201 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Automated review by review (OpenAI)

Reviewed head d1e8201386451bd663918deadc0bd62aa86f3a97 against base 65ea670311d68058f5c3df74af669bc09c324c5c. No actionable bugs found in the changed code.

The direction is sound: rs/moq-relay/src/auth/refresh.rs:598–673 reuses the transport harness, advances the installed clock past the original grant's expiry, and checks the actual refusal's decoded client error and failure accounting. The retained invalid-label case remains distinct. Parameterizing this helper is simpler than a second fixture; no additional abstraction is needed. The quest cleanup matches the coverage added.

GitHub-only source review of the diff and relevant grant validation, clock, close-code and stats paths; I did not run tests or independently verify the reported just check result.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing summary:

  • The config.websocket validation blocker was fixed on main by moq-dev/moq#6830; merged origin/main and dropped both finished quests from quest/m1/auth/README.md (this one and drain-token).
  • just check passed on the merged head (669 tests, including both pre-SETUP refusal cases); quest check --base origin/main clean.
  • Codex and the automated review found no issues on d1e8201386451bd663918deadc0bd62aa86f3a97. Test-only change: no API or wire impact.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
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: 28ef929e-4ff0-4682-b46f-446a822449a2
Commits

Reviewing files that changed from the base of the PR and between 65ea670 and d1e8201.

Files selected for processing: 3
  • quest/m1/auth/README.md
  • quest/m1/auth/expire-before-setup.md
  • rs/moq-relay/src/auth/refresh.rs
Files with no reviewable changes: 2
  • quest/m1/auth/README.md
  • quest/m1/auth/expire-before-setup.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The pre-SETUP grant test helper now accepts a grant mutation and an expected SessionError. Tests cover invalid labels returning Unauthorized and grants expiring before SETUP returning Expired, with failure-stat checks. The README entry and separate document for the expiry test were removed.

Priority: Low

Merge Risk: Minimal · up to d1e82

The expiry test checks the expected refusal through the client and its failure accounting. No issue identified here prevents merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding relay test coverage for grant expiry before SETUP.
Description check Passed The description is directly related to the changes. It explains the pre-SETUP expiry case, test updates, expected errors, validation, and scope.
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
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.99.0)

Clippy execution timed out

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.

Merged via the queue into main with commit 8e281b8 Oct 27, 2026
11 checks passed
@kixelated
kixelated deleted the quest/m1/auth/expire-before-setup branch October 27, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant