Conversation
Greptile SummaryThis PR fixes terminal backup/restore reliability by expanding the tar exclusion list to cover additional Android bind-mounts ( Key changes:
Confidence Score: 5/5Safe to merge — all remaining findings are minor style/documentation issues that do not affect runtime correctness under normal usage. The functional changes (extra excludes, src/plugins/terminal/www/Terminal.js — the unquoted glob on line 385 and the stale JSDoc on the restore() function. Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant TS as terminalSettings.js
participant EX as Executor
participant SD as sdcard API
participant SYS as system.copyToUri
participant T as Terminal.js
Note over U,T: Backup Flow
U->>TS: terminalBackup()
TS->>SD: FileBrowser folder picker
SD-->>TS: folder URL
TS->>T: Terminal.backup()
T->>EX: tar -cf aterm_backup.tar with excludes
EX-->>T: ok
T-->>TS: dataDirectory/aterm_backup.tar
TS->>SYS: copyToUri to selected folder
SYS-->>TS: done
TS->>U: alert success
Note over U,T: Restore Flow
U->>TS: terminalRestore()
TS->>EX: rm old aterm_backup files
EX-->>TS: done
TS->>SD: openDocumentFile application/x-tar
SD-->>TS: data.uri from user
TS->>SYS: copyToUri to aterm_backup.tar
SYS-->>TS: done
TS->>T: Terminal.restore()
T->>EX: set -e, rm existing, tar -xf aterm_backup glob
EX-->>T: ok
T-->>TS: ok
TS->>EX: rm aterm_backup temp files
EX-->>TS: done
TS->>U: alert success
Reviews (2): Last reviewed commit: "removed logging" | Re-trigger Greptile |
src/settings/terminalSettings.js
Outdated
| }, | ||
| toast, | ||
| "application/x-tar", | ||
| "application/octet-stream", |
There was a problem hiding this comment.
MIME type change widens file picker filter
Changing from "application/x-tar" to "application/octet-stream" makes the file picker show all files instead of only .tar archives. While this is a pragmatic choice given Android's inconsistent MIME type associations for .tar files, it means a user can accidentally select any binary file and attempt a restore with it. Terminal.restore() will only fail after copying the wrong file to $PREFIX and running tar -xf on it.
If application/x-tar did not work reliably on device (which is a valid reason), consider also trying "application/x-tar,application/octet-stream" as a comma-separated fallback list (if the sdcard.openDocumentFile API supports it), or at least add a filename validation step before the restore to check that the selected file ends with .tar.
Closes #1965