Repository navigation
Closed
Closed
Copy link
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
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
- Open the T3 mobile app with no environments connected.
- On four other computers, run T3 and name those environments A, B, C, and D. Leave all four running, and keep each connect address and code.
- In the app, open Settings, then Environments, then Add environment. Enter A's address and code, tap Add environment, and wait until A shows connected.
- Add environment B the same way and wait until it shows connected.
- Add environment C the same way and wait until it shows connected.
- Add environment D the same way and wait until it shows connected.
- Go back to Settings. Tap the button labeled Filter settings environments and projects, open the environments section, and tap C so its check turns off.
- Open that filter again and tap D so its check turns off. A and B stay checked.
- Open Environments and turn off the switch labeled Enable B.
- Go back to Settings, open the filter, and wait until B is no longer listed. A stays checked, and C and D stay unchecked.
- In that filter, tap C so its check turns on. Leave D unchecked.
- Open Environments and turn the switch Enable B back on. Wait until B shows connected.
- Go back to Settings and open the filter's environments section.
Expected behavior
A, B, and C are checked. D is unchecked. The environments section is titled 3 environments.
Actual behavior
A and C are checked. B and D are unchecked. The environments section is titled 2 environments.
Impact
Major degradation or frequent failure. People managing multiple environments lose an existing selection whenever they toggle another environment while a selected one is temporarily disconnected and at least one connected environment remains excluded.
Version or commit
main at e9b48b7809. The cause is at apps/mobile/src/features/settings/settings-environment-filter.logic.ts:9.
Environment
Pixel_9_API_37, Android 17.0.
Logs or stack traces
AssertionError: expected [ 'a', 'c' ] to deeply equal [ 'a', 'b', 'c' ]Automated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/apps/mobile/src/features/settings/settings-environment-filter.logic.test.ts b/apps/mobile/src/features/settings/settings-environment-filter.logic.test.ts
new file mode 100644
index 0000000000..5577960917
--- /dev/null
+++ b/apps/mobile/src/features/settings/settings-environment-filter.logic.test.ts
@@ -0,0 +1,24 @@
+import { EnvironmentId } from "@t3tools/contracts";
+import { describe, expect, it } from "vite-plus/test";
+
+import { toggleSettingsEnvironment } from "./settings-environment-filter.logic";
+
+describe("settings environment selection", () => {
+ it("keeps a selected offline environment when toggling another connected environment", () => {
+ const a = EnvironmentId.make("a");
+ const b = EnvironmentId.make("b");
+ const c = EnvironmentId.make("c");
+ const d = EnvironmentId.make("d");
+ const all = [a, b, c, d].map((environmentId) => ({ environmentId }));
+ const withoutC = toggleSettingsEnvironment(null, all, c);
+ const selected = toggleSettingsEnvironment(withoutC, all, d);
+ expect(selected).toEqual(new Set([a, b]));
+
+ const connected = all.filter((entry) => entry.environmentId !== b);
+ const next = toggleSettingsEnvironment(selected, connected, c);
+ const reconnectedTargets = all.filter(
+ (entry) => next === null || next.has(entry.environmentId),
+ );
+ expect(reconnectedTargets.map((entry) => entry.environmentId)).toEqual([a, b, c]);
+ });
+});cd apps/mobile && pnpm exec vp test run src/features/settings/settings-environment-filter.logic.test.tsWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.







Activity