The best way to control Claude Code, Codex and more from any computer or phone
fix(mobile): stop crashing on launch before the shell snapshot arrives (#11537)
Julius Marminge committed
Sep 12, 2026 at 23:33 UTC
8b3ddf51c59a54411cd02b321cb07f39c927df09
2 files changed
+12
-2
packages/shared/src/projectSettings.test.ts
+8
@@ -29,6 +29,14 @@ describe("resolveProjectSettings", () => {
29
);
30
});
31
32
+ it("treats a null project like an absent one before the shell snapshot arrives", () => {
33
+ // The mobile new-task flow resolves settings while its selected project is
34
+ // still null; reading the aggregate's legacy fields off null crashed launch.
35
+ expect(resolveProjectSettings(DEFAULT_SERVER_SETTINGS, null, null).settings).toBe(
36
+ DEFAULT_SERVER_SETTINGS,
37
+ );
38
+ });
39
+
40
it("applies overrides per key and reports their source", () => {
41
const settings = applyServerSettingsPatch(DEFAULT_SERVER_SETTINGS, {
42
defaultAutoPull: true,
packages/shared/src/projectSettings.ts
+4
-2
@@ -59,11 +59,13 @@ export interface LegacyProjectSettingsFields {
59
export function resolveProjectSettings(
60
settings: ServerSettings,
61
projectId: ProjectId | null,
62
- project?: LegacyProjectSettingsFields,
62
+ // Nullable, not just optional: the mobile new-task flow passes its selected
63
+ // project straight through, and that is null until the shell snapshot lands.
64
+ project?: LegacyProjectSettingsFields | null,
65
): ResolvedProjectSettings {
66
const stored = projectId === null ? undefined : settings.projectSettingsOverrides[projectId];
67
const overrides: ProjectSettingsOverrides =
66
- project === undefined || settings.projectSettingsFolded
68
+ project == null || settings.projectSettingsFolded
69
? (stored ?? EMPTY_OVERRIDES)
70
: {
71
...(project.defaultModelSelection != null