Skip to content

fix(mobile): respect notification permission when linking cloud environments - #9901

Open
Gigioxx wants to merge 1 commit into
pingdotgg:mainfrom
Gigioxx:t3code/fix-issue-9886
Open

Gigioxx wants to merge 1 commit into
pingdotgg:mainfrom
Gigioxx:t3code/fix-issue-9886

Conversation

@Gigioxx

@Gigioxx Gigioxx commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Mobile cloud linking always sends notificationsEnabled: true to the relay, even when the user denied notification permission or the build cannot receive agent notifications. This contradicts the privacy policy's "if you enable notifications" (#9886).

Change

Read the OS notification permission once during link and relink, and send that value in both the link challenge and the link request. The read only happens when supportsAgentAwarenessPush() reports agent notifications are supported, so iOS and Android builds with notification support use the real permission, and unsupported builds (iOS personal-team builds, Android builds without the native notifications module) send false. If the permission lookup fails, linking stops before contacting the relay. Live Activities keep their existing preference. Existing cloud links are not migrated.

Scope and approval

Fixes #9886. Small, focused fix for an obvious bug: a hardcoded true in the relay payload that ignores the user's notification permission. A maintainer reviewed the direction on this PR and asked for Android support to be included: #9901 (comment)

Verification

Reproduced before the original fix: the denied-permission case received notificationsEnabled: true in both relay payloads.

After rebasing onto current main and switching to the shared capability check:

  • vp test run src/features/cloud/linkEnvironment.test.ts in apps/mobile: 11 passed. Cases cover iOS denied/granted, Android denied/granted, an Android build without native notification support, permission lookup failure (no relay request), and both relay payloads. The test exercises the real supportsAgentAwarenessPush() with a mocked platform and Android native module.
  • With the previous iOS-only gate restored temporarily, the "Android granted permission" case fails (1 failed, 10 passed), so the test covers the Android regression.
  • vp lint and vp fmt --check on the changed files: clean. Mobile tsc --noEmit: no errors.

Not checked: a native device or simulator link against a real relay. No UI or wire-contract changes.

Original change by GPT-6 via Codex. Rebase, Android support, and description update by Claude Opus 5.5 via Claude Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 5, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The mobile cloud-link flow now persists a permission-dependent notification setting instead of always enabling notifications, and the relay uses that setting to control push delivery. The change is narrowly scoped and tested, with no schema changes, but it alters an existing product default and runtime behavior.

You can add or adjust custom eligibility rules. Learn more.

@shivamhwp

Copy link
Copy Markdown
Collaborator

Note: GPT-6 on behalf of shivam (@shivamhwp).

Please update the iOS-only gate for current main. #10416 added Android agent notifications, and supportsAgentAwarenessPush() now checks the Android native capability too. With Android push supported and notification permission granted, this PR still sends notificationsEnabled: false in both cloud-link requests.

Use the shared capability check for supported platforms and read permission for Android as well. Change the Android regression to expect true when granted, and retain false cases for denied permission and unsupported builds.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 1, 2026 — with ChatGPT Codex Connector
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 1, 2026
@Gigioxx
Gigioxx force-pushed the t3code/fix-issue-9886 branch from 9131579 to 5cef894 Compare October 1, 2026 05:19
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 3f43f44f-3a2c-4dba-bf1c-cfa37319aeb9

📥 Commits

Reviewing files that changed from the base of the PR and between c57a04b and 5cef894.

📒 Files selected for processing (2)
  • apps/mobile/src/features/cloud/linkEnvironment.test.ts
  • apps/mobile/src/features/cloud/linkEnvironment.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 1, 2026 05:19

Dismissing prior approval to re-evaluate 5cef894

@Gigioxx

Gigioxx commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

[claude-opus-5-5] Responding on behalf of Guille


Updated in 5cef894, rebased onto current main. Linking now reads notification permission whenever supportsAgentAwarenessPush() is true, so Android builds with native notification support send the real permission instead of false. The tests now exercise the real capability check with a mocked platform and Android native module: Android granted expects true, and Android denied, an Android build without native support, and iOS denied still expect false. With the old iOS-only gate restored, the Android granted case fails.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloud link hardcodes notificationsEnabled: true, contradicting the privacy policy's "if you enable notifications"

3 participants