Commit 5d315ac
authored
Resolve identities root inside setup() for Android/iOS (#7)
* Resolve identities root inside setup() so Android can initialize
On desktop, identities root comes from $DMP_DESKTOP_HOME /
$DMP_CONFIG_HOME / $HOME, resolved before the Tauri builder runs.
Mobile sandboxes don't expose $HOME, so that path bombed with
'cannot resolve identities root' before any UI could come up — the
process exit-2'd inside the JNI bridge and crash-looped.
Defer root resolution to the setup() callback. On Android/iOS,
ask Tauri for app_local_data_dir() (per-app private storage,
guaranteed writable). Desktop behavior is unchanged: same env-driven
resolution, same error surface if HOME is unset.
Verified locally: APK now gets past the early HOME crash. A separate
tao/Tauri runtime panic in onActivityCreate is the next blocker —
filed separately.
* gitignore: drop src-tauri/gen/ regenerated by mobile init
Tauri rebuilds gen/android (and gen/ios when wired) on every
`cargo tauri android init`, so we don't track it. Eliminates the
'1 uncommitted change' warning when local mobile builds run on
the side. Promote to a tracked dir if/when we customize the
AndroidManifest / icons / signing config.
* clippy: collapse nested if/let blocks into 2024 if-let chains
Rust 1.95 + edition 2024 promoted `clippy::collapsible_if` and the
`if let chains` syntax. CI runs clippy with `-D warnings`, so the
four pre-existing nested patterns now fail the build:
src/commands/identity.rs:485
src/commands/nodes.rs:403
src/commands/nodes.rs:482
src/commands/nodes.rs:869
Mechanical rewrite — same control flow, same behavior, just expressed
as `if let X && cond { ... }` instead of `if let X { if cond { ... } }`.
Required edition 2024 (already set on this branch via main).1 parent 2fa5a4b commit 5d315ac
4 files changed
Lines changed: 48 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | 42 | | |
51 | 43 | | |
52 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
0 commit comments