Skip to content

fix(cloudmatch): preserve session-stable appLaunchMode in resume - #599

Merged
zortos293 merged 2 commits into
devfrom
capy/session-stable-app-launch-mode
Jul 5, 2026
Merged

fix(cloudmatch): preserve session-stable appLaunchMode in resume#599
zortos293 merged 2 commits into
devfrom
capy/session-stable-app-launch-mode

Conversation

@zortos293

@zortos293 zortos293 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

| This PR fixes resume instability caused by renegotiating the immutable appLaunchMode parameter. Claim requests now send the wire value echoed by the server when the session was created, instead of the live UI settings.appLaunchMode toggle.


Types & Data Flow

  • opennow-stable/src/shared/gfn.ts - Added appLaunchMode?: number to ActiveSessionInfo and SessionClaimRequest
  • opennow-stable/src/main/gfn/types.ts - Typed sessionRequestData.appLaunchMode in SessionEntry

CloudMatch Payloads

  • opennow-stable/src/main/gfn/cloudmatch.ts - getActiveSessions parses and returns appLaunchMode from the /v2/session list response
  • opennow-stable/src/main/gfn/cloudmatch.ts - buildClaimRequestBody accepts an optional sessionAppLaunchMode overriding the default settings-derived value
  • opennow-stable/src/main/gfn/cloudmatch.ts - claimSession threads input.appLaunchMode into buildClaimRequestBody

Call Sites

  • opennow-stable/src/renderer/src/App.tsx - Pass existingSession.appLaunchMode/candidate.appLaunchMode to claimSession in resume and recovery paths
  • opennow-stable/src/main/ipc/sessionHandlers.ts - Pass readyCandidate.appLaunchMode to claimSession in the create-session fallback path

Tests

  • opennow-stable/src/main/gfn/cloudmatch.test.ts - Added regression test asserting claim payload uses session-stable appLaunchMode over live settings

Open OPE-248 OPE-248


Note

Medium Risk
Touches all session resume/claim paths for GFN CloudMatch; behavior change is narrow but session connectivity is user-critical if the echoed value is missing or wrong.

Overview
Resume/claim no longer renegotiates appLaunchMode from the live stream settings toggle, which was causing CloudMatch resume failures when the UI mode differed from the session the server created.

Active-session listing now captures the wire appLaunchMode echoed in sessionRequestData and exposes it on ActiveSessionInfo. Claim PUT payloads prefer that session-stable value in buildClaimRequestBody, with a fallback to settings-derived wire values when it is missing. Renderer resume/recovery and main-process create-session claim paths pass appLaunchMode through to claimSession. A regression test asserts the claim body keeps the original mode even when current settings say default.

Reviewed by Cursor Bugbot for commit 38febbf. Configure here.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@zortos293 zortos293 added the capy Generated by capy.ai label Jul 5, 2026 — with Image Capy AI
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b5f019fa-d0de-46a1-978c-36eeb8619f49

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch capy/session-stable-app-launch-mode

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38febbfe60

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

...resolveResumeIdentity(candidate.sessionId),
recoveryMode: true,
appId: resolveSessionClaimAppId(candidate),
appLaunchMode: candidate.appLaunchMode,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Carry appLaunchMode through persisted recovery fallback

When recovery falls back to runtimeSnapshotRef.current.resumeContext because the active-session list has no ready candidate, that synthetic candidate is built from persisted fields that do not include appLaunchMode (runtimeSnapshot.ts only stores session/server/app identity). In that transient-list-miss recovery path, this new argument is always undefined, so claimSession falls back to the current UI-derived settings and can still renegotiate a gamepad/touch-created session back to default. Persist/carry the session's wire mode, or recover it from the session GET, before claiming from this fallback.

Useful? React with 👍 / 👎.

…table recovery claims

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@zortos293
zortos293 merged commit 2b93183 into dev Jul 5, 2026
16 checks passed
Chizuui pushed a commit to Chizuui/OpenNOW-Modified that referenced this pull request Aug 11, 2026
…nCloudGaming#599)

* Pass session-stable appLaunchMode in claim/resume requests

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* Persist session appLaunchMode through snapshots and poll merges for stable recovery claims

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant