[Bug]: iOS trash button does not remove a persisted environment #12012
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/mobile
Steps to reproduce#
- Install the current T3 Code iOS app from the App Store.
- Open Environments; a direct environment saved by an older installation is restored even after reinstalling the app.
- Expand the stale/offline environment.
- Tap the red trash button.
- Force-quit/relaunch the app and restart the iPhone, then repeat.
The stale row in this reproduction is a direct saved environment, not a T3 Connect relay environment.
Expected behavior#
Tapping the trash button should present the “Remove from this device?” confirmation and, after confirmation, remove the saved environment and its local credentials/catalog data.
Actual behavior#
Tapping the trash button has no visible effect: no confirmation alert appears and the environment is not removed. The behavior persists after force-quitting the app and restarting the iPhone.
The environment also survives deleting and reinstalling the app. This is consistent with the catalog being stored through Expo SecureStore/iOS Keychain (t3code.connection-catalog.v1), whose data can survive reinstall. The current mobile handler appears intended to call Alert.alert("Remove from this device?", ...), but that alert is never presented in this state.
Relevant source paths:
apps/mobile/src/state/use-remote-environment-registry.ts(onRemoveEnvironmentPress)apps/mobile/src/connection/catalog-store.tsapps/mobile/src/persistence/mobile-secure-storage.ts
Impact#
Minor bug or occasional failure
Version or commit#
Current iOS App Store release installed 2026-09-15 (exact build not shown)
Environment#
T3 Code iOS app on iPhone; direct saved environment; stale endpoint offline
Logs or stack traces#
Screenshots, recordings, or supporting files#
No response
Workaround#
None. Force-quit, restart, and reinstall do not clear the entry because the connection catalog persists in iOS Keychain. The stale row can only be ignored.
joeviezner(GitHub profile, opens in a new tab) added labelsbug
joeviezner(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge removed labelsneeds-triage
juliusmarminge added labelsaccepted
juliusmarminge added labelsvia-triage
I'd like to work on this. My understanding is that the Environments trash control never presents its "Remove from this device?" confirmation, so it never removes the saved direct environment; the fix should present the confirmation and delete the persisted environment/catalog entry, validated on iOS. Is it available for me to take?
I'd like to take this. I'll follow the direction in the maintainer triage above and open a focused PR with before/after evidence, noting the model and harness used.
Opened a PR for this: https://github.com/pingdotgg/t3code/pull/18228
It makes the trash always present the confirm (labelled by id if the row is missing from the connected list) and reports a failed removal instead of dropping it. I could not reproduce the invisible-confirm theory on the iOS 26.3 or 18.3 simulators with current main, so the PR leaves the native
Alert.alertin place. The details, including what I forced and could not check, are in the PR description.Model and harness: Claude Sonnet 5.5 via Claude Code in T3 Code.
juliusmarminge added labelsneeds more info
juliusmarminge removed labelsneeds more info
Tried this on an iOS simulator and could not reproduce it.
What was run
- T3 Code Preview, static iOS simulator build of
b5a226e49c(app version 2.0.0). The Environments, trash and confirm code (ConnectionEnvironmentRow,onRemoveEnvironmentPressinuse-remote-environment-registry.ts, the catalog store) is unchanged between that commit and currentmain(ed3f965e07). - Remote iOS simulator. The Keychain catalog held one direct saved environment ("Stale offline direct environment", route
http://127.0.0.1:1) that was offline: the home header showed "Reconnecting…" and the details showedCause: network, 8 failed attempts. - Settings → Environments (1) → the environment → Expand details → red trash.
What happened
- The trash presented "Remove from this device?" over the Settings sheet (attached).
- Remove → "This environment is no longer saved on this device."
- After force-quitting and relaunching, the app showed "No environments connected", so the entry was gone from the Keychain catalog too.
So on this build, an offline direct environment restored from the Keychain can be removed.
What would help
- The exact app version and build: Settings → About, or the App Store version line. The report says the build was not shown, and the September release is several versions behind.
- Whether it still happens after updating to the current App Store release.
- A screen recording of the tap on the trash, and your iOS version.
- T3 Code Preview, static iOS simulator build of
juliusmarminge added labelsneeds more info
Closing: no reply in 7 days after we asked for more information. Comment with the missing details and we will reopen.
Sign in to join this conversation.
Triage#
Confirmed on current
main(935c55b37). This is a real iOS mobile bug, not a wash of #9761. A direct saved environment can be restored from Keychain after delete+reinstall, and the Environments trash control never presents its confirm, so the row cannot be forgotten.What the code does#
Settings → Environments lists catalog presentations, including offline/disabled ones. A direct (non-relay) row is
ConnectionEnvironmentRow: expand, then the red trash. That is the control in this report, not the T3 Connect long-press path.Trash calls
onRemoveEnvironmentPressinapps/mobile/src/state/use-remote-environment-registry.ts. The only skip beforeAlert.alert("Remove from this device?", …)is a lookup inconnectedEnvironments. The list and the handler share that array, so a visible row should match — but the silentreturnis still a landmine (any identity/stale-closure miss eats the tap with no feedback).If the alert did show and the user confirmed, remove is real:
environmentCatalog.remove→EnvironmentRegistry.remove→removeConnectionFromCatalog→ SecureStoret3code.connection-catalog.v1.That document is why reinstall does not help. Mobile persists the catalog through Expo SecureStore / iOS Keychain (
catalog-store.ts,mobile-secure-storage.ts).app.config.tsalso setskeychain-access-groups(#3665). iOS keeps those items across delete+reinstall. Settings → Client Storage only clears thread/cache data; it does not drop the catalog.Why the confirm never appears#
Two stacked presentation problems, both still on
main:SettingsSheetuses form-sheet presentation, then a headerless stack, then Environments. RNAlert.alertpresents aUIAlertControllerfrom the key window — a known miss insidereact-native-screensform sheets / nested nav. The confirm is invoked and never visible, which matches “tap trash, nothing happens.” Other Settings alerts sit on the sheet root; this is the only confirm on the pushed Environments screen.FadeInblock that mounts only after expand (ConnectionEnvironmentRow). First taps during layout/FadeIncan be dropped.Either one is enough for a dead trash on a stale row. The Keychain restore just makes it permanent: the endpoint is offline, Off still leaves the row, reinstall brings it back, and the only forget control is the one that does not present.
First engineering step: reproduce on device/simulator — Settings formSheet → Environments → expand an offline direct row → trash. Confirm whether
Alert.alertis called and whether aUIAlertControlleris sitting behind the sheet.Related, not duplicates#
Closes #12012.Alert.alert+ catalog remove.No open PR claims the direct-row confirm / persist path.
Suggested fix#
Keep this as a bugfix on
apps/mobile(direct Environments row only):returnwhen the list lookup misses; fall back to the environment id for the label.showConfirmDialog/ a sheet-local modal), notAlert.alert.ConfirmDialogHostalready exists because native dialogs are unreliable on one platform; the Settings formSheet needs the same treatment on iOS.SecureStore.setItem/removefails, show an error and keep the row. A successful in-memory remove plus a failed Keychain write is how a “removed” environment comes back on the next launch.Do not fold this into #9761 (relay deregister) or #8923 (catalog backup).
Workaround#
None in-app. Off only silences the row. Client Storage does not drop credentials. Delete+reinstall restores the same catalog. Until a build with the fix ships, the stale direct row can only be ignored.
Classification: bug · accepted · minor–medium (iOS; cannot forget a Keychain-restored direct environment) Labels: add
accepted,via-triage; keepbug; removeneeds-triageDiscord tags:mobile-ios,persistence,ui