fix(files): recover folder grant ownership - #445
Conversation
Obiente previewNC Native · Obiente updates this comment as the preview changes. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
7dfaeb8 to
d963ee4
Compare
8536f7f to
dfecb8d
Compare
d963ee4 to
b2c2188
Compare
03d8e39 to
3d48cc7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d48cc7639
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6057f39 to
a712498
Compare
f26e9a4 to
3f91e1b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f91e1bfab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cc5f869 to
337b65f
Compare
bde44c3 to
ec6875c
Compare
337b65f to
4cfb960
Compare
6be731b to
36a8f5b
Compare
54c77f1 to
30d6eb1
Compare
36a8f5b to
1cd6faa
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cd6faadc4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else { | ||
| check(prepareAndFinishCleanup(record)) { CLEANUP_RETRY_MESSAGE } |
There was a problem hiding this comment.
Keep restored setup roots valid through restart
When Android kills the process while the add-folder dialog is open, rememberSaveable restores the SAF URI, but startup reaches this branch because the capability has an old process generation and no committed pair, releasing the grant and removing its record. The restored dialog then points at an unusable capability, so adding the pair races reconciliation and typically fails while dismissal can leave the draft stuck. Unlike the earlier activity-recreation comment, the fresh evidence is this new old-generation cleanup path; either avoid saving the capability URI across process death or durably reattach the restored draft before reconciliation.
AGENTS.md reference: AGENTS.md:L245-L248
Useful? React with 👍 / 👎.
| fun abandon(localRootId: String): Boolean = | ||
| runCatching { capabilities.abandonSelection(localRootId) }.getOrDefault(false) |
There was a problem hiding this comment.
Treat non-SAF roots as already abandoned
When a user opens and dismisses a detected media suggestion, its root starts with media-store://, so it has no capability record and abandonSelection returns false. FileSyncSetupDraftState.abandon consequently retains that root while clearing its configuration, and beginAddFolderSync then refuses to open the native picker because every cleanup retry returns false. Return success for roots that never use SAF grants while reserving false for an actual pending cleanup.
Useful? React with 👍 / 👎.
bcae385 to
1caca52
Compare
Summary
Validation