Skip to content

test(e2e): the persistent-questions session ends with the token that opened it - #1144

Merged
frontegg-david merged 1 commit into
release/1.11.xfrom
fix/e2e-persistent-questions-session-token
Nov 5, 2026
Merged

frontegg-david merged 1 commit into
release/1.11.xfrom
fix/e2e-persistent-questions-session-token

Conversation

@frontegg-david

@frontegg-david frontegg-david commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The pre-release E2E gate of Publish Release failed on persistent-questions.e2e.spec.ts › "keeps an answer for the next session when the waiting session ends" (run 42081062660). It also failed twice on #1141, and passed elsewhere.

The test ends its MCP session with a DELETE, but it signed the DELETE with a token minted then, not the one the session was opened with. A streamable-HTTP session id is bound to the signature of the token that created it (authSig). TestTokenFactory tokens have no jti and second-resolution iat/exp, so the two tokens were byte-identical only when both were minted in the same second. When the test crossed a second boundary, session:verify didn't verify the session id and the DELETE answered 404.

The test now opens the session with a token it keeps, and ends it with that token. The server is unchanged: a session id is honored only for the token that opened it.

Tests

  • With a 1.1 s wait added before the DELETE, the old test fails every time (404) and the fixed one passes.
  • persistent-questions.e2e.spec.ts passes locally (the frontmcp inbox case needs the CLI build and runs in CI).

Summary by CodeRabbit

  • Tests
    • Updated end-to-end session coverage to use the same authentication token when connecting to and ending a session. This change affects test behavior only; no user-facing functionality has changed.

…opened it, so the DELETE no longer 404s when a second passes
@frontegg-david
frontegg-david marked this pull request as ready for review November 5, 2026 18:29
@frontegg-david

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The connect helper now delegates to connectWithToken, which accepts a pre-created token. The session-ending test uses the same Alice token to open the session and send the ending request.

Changes: E2E session token reuse

Layer / File(s) Summary
Connection helper and session-ending test
apps/e2e/demo-e2e-elicitation/e2e/persistent-questions.e2e.spec.ts
connect delegates connection setup to connectWithToken. The session-ending test reuses Alice’s opening token for the ending request.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: alexmercerpo

Merge Risk: Minimal · up to fdb42

The test now uses the session’s original token when ending it. No merge-blocking risk is established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the change: the persistent-questions E2E test now ends its session with the token that opened it. The raw summary confirms the test now reuses the original token for connecting and del…
Description check Passed The description explains the failure on the persistent-questions E2E test. It gives the cause: a session id is bound to the signature of the token that opened it, and tokens minted in different second…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Title check

Explanation

The title names the change: the persistent-questions E2E test now ends its session with the token that opened it. The raw summary confirms the test now reuses the original token for connecting and deleting the session, so the title matches the main change. It is specific and fits the test(e2e) convention.

Full details: Description check

Explanation

The description explains the failure on the persistent-questions E2E test. It gives the cause: a session id is bound to the signature of the token that opened it, and tokens minted in different seconds differ. It states the fix, which opens and ends the session with one kept token, and that the server is unchanged. The Tests section lists a reproduction with a 1.1 s wait and local test results. The template's 'What and why' and 'Tests' sections are filled in. The 'User-facing change' section is omitted, which is correct because the change is test-only. The description does not mention the issue it closes, but the template asks for it only 'if any'.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3b847c4 and fdb4201.

Files selected for processing: 1

  • apps/e2e/demo-e2e-elicitation/e2e/persistent-questions.e2e.spec.ts

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

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@frontegg-david
frontegg-david merged commit f502e5a into release/1.11.x Nov 5, 2026
45 checks passed
@frontegg-david
frontegg-david deleted the fix/e2e-persistent-questions-session-token branch November 5, 2026 18:41
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick Created

A cherry-pick PR to main has been automatically created.

Please review and merge if this change should also be in main.

If the cherry-pick is not needed, close the PR.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Performance Test Results

Status: ✅ All tests passed

Summary

Project Tests Passed Warnings Failed Leaks
✅ demo-e2e-agents 4 4 0 0 0
✅ demo-e2e-cache 11 11 0 0 0
✅ demo-e2e-codecall 4 4 0 0 0
✅ demo-e2e-config 4 4 0 0 0
✅ demo-e2e-direct 3 3 0 0 0
✅ demo-e2e-elicitation 1 1 0 0 0
✅ demo-e2e-errors 4 4 0 0 0
✅ demo-e2e-hooks 3 3 0 0 0
✅ demo-e2e-multiapp 4 4 0 0 0
✅ demo-e2e-notifications 3 3 0 0 0
✅ demo-e2e-openapi 2 2 0 0 0
✅ demo-e2e-providers 4 4 0 0 0
✅ demo-e2e-public 4 4 0 0 0
✅ demo-e2e-redis 15 15 0 0 0
✅ demo-e2e-remember 4 4 0 0 0
✅ demo-e2e-remote 5 5 0 0 0
✅ demo-e2e-serverless 2 2 0 0 0
✅ demo-e2e-skills 15 15 0 0 0
✅ demo-e2e-standalone 2 2 0 0 0
✅ demo-e2e-transport-recreation 3 3 0 0 0
✅ demo-e2e-ui 4 4 0 0 0

Total: 101 tests across 21 projects

📊 View full report in workflow run


Generated at: 2026-11-05T18:43:14.111Z
Commit: e23bfc11

frontegg-david added a commit that referenced this pull request Nov 5, 2026
…e token that opened it (#1145)

Cherry-picked from #1144 (merged to release/1.11.x)
Original commit: f502e5a

Co-authored-by: agentfront[bot] <agentfront[bot]@users.noreply.github.com>
Co-authored-by: frontegg-david <69419539+frontegg-david@users.noreply.github.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