Skip to content

fix(syncdeck): support LMS iframe waiting handoffs - #333

Merged
mrbdahlem merged 4 commits into
mainfrom
fix/learn-syncdeck-iframe-handoff
Aug 9, 2026
Merged

fix(syncdeck): support LMS iframe waiting handoffs#333
mrbdahlem merged 4 commits into
mainfrom
fix/learn-syncdeck-iframe-handoff

Conversation

@mrbdahlem

@mrbdahlem mrbdahlem commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Improved Learn student waiting-room launches embedded in LMS iframes.
    • Production handoff cookies now support secure cross-site iframe polling with appropriate privacy protections.
    • Development environments retain local HTTP-compatible cookie behavior.
  • Documentation

    • Added deployment guidance for HTTPS requirements and iframe-based waiting-room launches.
    • Documented cookie validation and active waiting-room handoff behavior.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 28 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: ASSERTIVE

Plan: Pro Plus

Run ID: c15cf586-c22d-4fbe-989d-7a31fad1a52d

📥 Commits

Reviewing files that changed from the base of the PR and between 95cc896 and a606d43.

📒 Files selected for processing (4)
  • .agent/knowledge/data-contracts.md
  • DEPLOYMENT.md
  • activities/syncdeck/server/learnIntegration.test.ts
  • activities/syncdeck/server/learnIntegration.ts
📝 Walkthrough

Walkthrough

The Learn SyncDeck waiting-room handoff now sets production cookies with SameSite=None, Secure, Partitioned, and HttpOnly. Tests, deployment guidance, and the data contract document the environment-specific behavior.

Changes

Learn SyncDeck cookie handoff

Layer / File(s) Summary
Waiting-room cookie contract and enforcement
activities/syncdeck/server/learnIntegration.ts, activities/syncdeck/server/learnIntegration.test.ts, .agent/knowledge/data-contracts.md, DEPLOYMENT.md
Production uses SameSite=None and Partitioned for the httpOnly waiting-room cookie. Non-production retains SameSite=Lax. Tests assert the production attributes, and documentation records the HTTPS requirement and handoff contract.

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

Possibly related PRs

🚥 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 clearly summarizes the main change: supporting LMS iframe waiting-room handoffs in SyncDeck.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/learn-syncdeck-iframe-handoff

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: 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 `@activities/syncdeck/server/learnIntegration.test.ts`:
- Around line 132-139: Add a separate non-production test alongside the existing
production coverage, setting NODE_ENV to a non-production value and asserting
the cookie options include sameSite: 'lax', secure: false, and partitioned:
false. Preserve the current production assertions and reuse the existing Learn
integration test setup and cleanup.
🪄 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: ASSERTIVE

Plan: Pro Plus

Run ID: d2b1d481-0fac-4394-970e-23ab9e638420

📥 Commits

Reviewing files that changed from the base of the PR and between a77cb83 and 95cc896.

📒 Files selected for processing (4)
  • .agent/knowledge/data-contracts.md
  • DEPLOYMENT.md
  • activities/syncdeck/server/learnIntegration.test.ts
  • activities/syncdeck/server/learnIntegration.ts

Comment thread activities/syncdeck/server/learnIntegration.test.ts

Copilot AI 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.

Pull request overview

This PR updates the Learn→SyncDeck student waiting-room browser handoff to work when launched inside an LMS-hosted iframe by switching the handoff cookie to a production-only Secure; SameSite=None; Partitioned httpOnly cookie, and adds documentation + tests to lock in the behavior.

Changes:

  • Update the Learn waiting-room launch route to issue a production-only cross-site iframe-compatible handoff cookie (SameSite=None, Secure, Partitioned).
  • Add server integration tests asserting cookie attributes in both development and production NODE_ENV modes.
  • Document HTTPS requirements and the iframe waiting-room handoff contract.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
DEPLOYMENT.md Documents the HTTPS requirement and cookie attributes for LMS iframe waiting-room launches.
activities/syncdeck/server/learnIntegration.ts Adjusts the learn_syncdeck_wait cookie attributes for production iframe compatibility.
activities/syncdeck/server/learnIntegration.test.ts Adds coverage for cookie attributes in non-production and asserts production attributes in the main flow test.
.agent/knowledge/data-contracts.md Records the iframe waiting-room handoff contract and test/validation expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .agent/knowledge/data-contracts.md Outdated
Comment thread DEPLOYMENT.md Outdated

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

activities/syncdeck/server/learnIntegration.ts:972

  • The new LMS-iframe handoff cookie is a third-party cookie in production (SameSite=None). It’s currently a session cookie (no maxAge/expires), so it can persist longer than the server-side waiting-room entry TTL and longer than needed for the handoff. Consider bounding its lifetime to WAITING_TTL_MS to reduce unnecessary third-party cookie retention and keep client/server TTLs aligned.
    res.cookie?.('learn_syncdeck_wait', cookieValue(key.secret, token.mappingId), {
      path: '/',
      httpOnly: true,
      sameSite: isProduction ? 'none' : 'lax',
      secure: isProduction,

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

activities/syncdeck/server/learnIntegration.ts:972

  • The waiting-room handoff cookie is scoped to path: '/', but it is only read by the /api/integrations/learn/v1/activities/syncdeck/wait/status flow. Scoping the cookie path to the narrowest route prefix reduces exposure to unrelated endpoints (and avoids the cookie being sent on other requests unnecessarily).
      maxAge: WAITING_TTL_MS,
      path: '/',
      httpOnly: true,
      sameSite: isProduction ? 'none' : 'lax',
      secure: isProduction,
      partitioned: isProduction,

activities/syncdeck/server/learnIntegration.test.ts:320

  • If the handoff cookie path is narrowed to the wait/status API prefix, this assertion should be updated accordingly (otherwise the test will keep passing even if the cookie remains overly broad).
    assert.equal(waitCookie?.options.maxAge, 10 * 60 * 1000)
    assert.equal(waitCookie?.options.path, '/')
    assert.equal(waitCookie?.options.sameSite, 'none')
    assert.equal(waitCookie?.options.secure, true)

@mrbdahlem
mrbdahlem merged commit 784d666 into main Aug 9, 2026
17 checks passed
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.

2 participants