fix(mobile): stop a directly-saved backend from hiding its T3 Connect environment - #7086
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: 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. |
- 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
## 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
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.CloudEnvironmentRowsreadsavailableRelayEnvironments, 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
relayManagedEnvironmentIdshelper 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
Verification
Reverting the filter inside
relayManagedEnvironmentIdsfails both new tests: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
relayManagedEnvironmentIdshelper used bysplitEnvironmentSectionsanduseConnectionController.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,
splitEnvironmentSectionssuppressed 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.relayManagedEnvironmentIdsin environmentSections.ts to compute only the IDs of relay-managed connections, excluding locally saved backends.splitEnvironmentSectionsto userelayManagedEnvironmentIdswhen filtering available cloud environments, so locally saved backends no longer suppress their cloud counterpart.useConnectionControllerto userelayManagedEnvironmentIdsforregisteredIdsconsistently.Macroscope summarized 6213c7e.