Skip to content

fix(mobile): stop a directly-saved backend from hiding its T3 Connect environment - #7086

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
Rishet11:fix/5242-connect-env-hidden
Aug 22, 2026
Merged

fix(mobile): stop a directly-saved backend from hiding its T3 Connect environment#7086
maria-rcks merged 1 commit into
pingdotgg:mainfrom
Rishet11:fix/5242-connect-env-hidden

Conversation

@Rishet11

@Rishet11 Rishet11 commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

What Changed

On mobile, saving a backend directly made the matching T3 Connect environment disappear from the connection screen. If you added a backend by pairing URL and that backend already existed as a cloud environment, the cloud row for it showed up nowhere: not under T3 Connect as a connected environment, and not in the list of environments still available to add. The only way to get it back was to remove the direct connection.

The cloud list hides anything you have already added, so the same environment is not offered twice. That "already added" set was built from every connected environment, including ones saved directly. A directly-saved backend does not occupy a T3 Connect slot though, so it should not be in that set. It landed there anyway, the cloud row got filtered out as a duplicate, and the bucket that would have shown it (connectedCloudEnvironments) only accepts relay-managed entries, so it was dropped there too.

The set is now built from relay-managed environments only. A backend you saved directly still appears as a local connection, and its cloud counterpart stays offered under T3 Connect.

Why

The same "which ids are already taken" logic existed twice, and both copies were wrong the same way:

  • useConnectionController.registeredIds — this is the one users see. CloudEnvironmentRows reads availableRelayEnvironments, which is filtered by this set.
  • splitEnvironmentSections.savedEnvironmentIds — same defect in the helper that splits the settings screen into sections.

Rather than patch the same condition in two places and let them drift again, this pulls it into one exported relayManagedEnvironmentIds helper that both call. That also puts the logic somewhere it can actually be tested: the hook needs atom mocking to exercise directly, the helper is a pure function sitting next to an existing test file.

UI Changes

n/a - no layout or styling change. The difference is which rows the T3 Connect section lists.

I could not capture a device before/after for this one. Reproducing it on a simulator needs a real T3 Connect account holding an environment whose id also matches a directly-paired backend, which I do not have. The behaviour is covered by unit tests on the shared helper instead, described below.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes (see note above)
  • I included a video for animation/interaction changes (n/a)

Verification

vp test run apps/mobile/src/features/connection/environmentSections.test.ts   # 7 passed
vp run --filter @t3tools/mobile typecheck                                     # exit 0
vp lint <the three touched files>                                             # clean
vp fmt --check <the three touched files>                                      # clean

Reverting the filter inside relayManagedEnvironmentIds fails both new tests:

FAIL  relayManagedEnvironmentIds > leaves out a backend that was saved directly
      expected [ 'environment-local', …(1) ] to deeply equal [ 'environment-cloud' ]
FAIL  mobile environment settings sections > still offers a cloud environment saved directly as a local backend
      expected [] to deeply equal [ 'environment-cloud' ]

The five pre-existing tests in that file pass either way. The one worth calling out is "does not duplicate a saved relay environment in the available cloud listing" — its environment is relay-managed, so it is still in the set and still filtered out. The de-duplication that test protects is unaffected.

Fixes #5242

Implemented with Claude Opus 5 via Claude Code.


Note

Low Risk
Localized mobile connection-list filtering with a shared pure helper and new unit tests; no auth, persistence, or API changes.

Overview
Fixes a case where pairing a backend directly could make the same-id T3 Connect environment vanish from the connection UI: it was neither listed as connected cloud nor as available to add.

“Already taken” environment ids for hiding duplicate cloud rows now come only from relay-managed connections, via a shared relayManagedEnvironmentIds helper used by splitEnvironmentSections and useConnectionController.registeredIds. Direct/local backends no longer suppress the matching cloud listing.

Unit tests cover the helper and the settings-section split when a cloud id is saved only as a local backend.

Reviewed by Cursor Bugbot for commit 6213c7e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix directly-saved backends hiding their T3 Connect cloud environment in mobile

Previously, splitEnvironmentSections suppressed a cloud environment if any saved backend shared its ID, including locally saved (non-relay-managed) backends. This meant a directly saved backend would hide its corresponding T3 Connect cloud environment.

  • Adds relayManagedEnvironmentIds in environmentSections.ts to compute only the IDs of relay-managed connections, excluding locally saved backends.
  • Updates splitEnvironmentSections to use relayManagedEnvironmentIds when filtering available cloud environments, so locally saved backends no longer suppress their cloud counterpart.
  • Updates useConnectionController to use relayManagedEnvironmentIds for registeredIds consistently.

Macroscope summarized 6213c7e.

Copilot AI lite review requested due to automatic review settings August 15, 2026 12:52

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6dfddb25-3c5a-4f2a-826e-67faade8d1e1

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

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.

@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 Aug 15, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR changes runtime behavior by altering which environments are visible to users - directly-saved backends will no longer hide T3 Connect cloud environments with matching IDs. While well-tested, this user-facing behavioral change warrants human verification.

You can customize Macroscope's approvability policy. Learn more.

@maria-rcks
maria-rcks merged commit 035058a into pingdotgg:main Aug 22, 2026
18 checks passed
BarretoDiego added a commit to BarretoDiego/t3code that referenced this pull request Aug 22, 2026
- Corrige backend salvo diretamente que ocultava seu ambiente T3 Connect (pingdotgg#7086), ajustando `environmentSections` e o `useConnectionController`
- Corrige queries de busca de thread grandes demais que derrubavam os clients (pingdotgg#6633), em `threadSearch` no `client-runtime`
- Adiciona cobertura de testes para os dois casos: `environmentSections.test.ts`, `threadSearch.test.ts` e `DesktopClientSettings.test.ts`
- 2 commits do upstream, 6 arquivos alterados (+114/-15), sem conflitos com as modificações do fork

Sync automatico t3code-sync em 2026-08-22T00:08:13-03:00
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 22, 2026
## What's Changed
* fix(search): oversized thread queries no longer crash clients by @Lucenx9 in pingdotgg/t3code#6633
* fix(mobile): stop a directly-saved backend from hiding its T3 Connect environment by @Rishet11 in pingdotgg/t3code#7086


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260822.1155...v0.0.34-nightly.20260822.1156

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260822.1156
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[Bug]: T3 Connect environment hidden when the same backend is saved directly

3 participants