feat(accounts): add platform credential slots - #436
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5e6014e2e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0bb0e52ff
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6dabe16e75
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5849f1719f
ℹ️ 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".
d6d0017 to
4daca37
Compare
4daca37 to
f7931ce
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7931ce047
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b1e4cb658
ℹ️ 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".
0b1e4cb to
c0526df
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0526df17f
ℹ️ 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".
c0526df to
bbc70fc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbc70fc564
ℹ️ 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".
28965a7 to
1d310d0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03b87ef871
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5ec23a01c
ℹ️ 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".
| SupportSettingsDraftRegistry.removeAccount(accountStorageKey) | ||
| removeCalendarWorkspaceMemory(accountStorageKey) | ||
| removeUserStatusWorkspaceMemory(accountStorageKey) | ||
| removeNextcloudNativeWorkspaceMemory(accountStorageKey) |
There was a problem hiding this comment.
Purge media-viewer routes with the removed account
When a user leaves a media viewer through shell navigation and later removes the account, the top-level mediaViewerNavigationRepository still retains its RouteContent, including private NextcloudFile names, paths, and owner metadata. This cleanup clears timeline/activity/Talk state but cannot clear that repository because its opaque route keys contain no account identity. Fresh evidence beyond the earlier memory-cache reports is this independent repository at NextcloudNativeApp.kt:307, whose routes are not released by shell navigation at lines 2595-2601; make routes account-owned and retire them here so removal does not leave account metadata in process memory.
AGENTS.md reference: AGENTS.md:L410-L413
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a600fb5fb
ℹ️ 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".
| { virtualFileCache.clearAccount(accountIdentity) }, | ||
| { mutationRecovery.clearDurableRecoveries(durableMutationAccountScope(session)) }, | ||
| { mutationRecovery.clearPendingDynamicMutations(cacheIdentity) }, | ||
| { AccountPrivateMemoryCleanup.removeAccount(session.accountId.storageKey) }, |
There was a problem hiding this comment.
Retire workspace writers before deleting preferences
When account removal overlaps a still-composed Home save, the preference deletion at lines 51-55 can finish while the old AccountHomeWorkspaceStorage producer remains accepted until this final retirement step, allowing the delayed save to recreate the deleted layout or pin values before the journal is cleared. Fresh evidence beyond the prior home-workspace report is this final cleanup ordering: move the retirement gate ahead of the preference deletion (in all three cleanup variants) so stale writers are rejected first.
AGENTS.md reference: AGENTS.md:L327-L329
Useful? React with 👍 / 👎.
| Result.success() | ||
| } | ||
| runCatching { | ||
| val userId = services.loadServerInfo(session).userId |
There was a problem hiding this comment.
Lease schedule restoration to its account
When account removal or account switching overlaps this added schedule-restoration worker, it captures the old session and performs loadServerInfo() outside ANDROID_ACCOUNT_OPERATION_GUARD, so credential removal does not wait for it. The removal path's asynchronous WorkManager cancellation also cannot interrupt the synchronous OkHttp Call.execute() used by these requests, allowing authenticated GETs with the retired credentials to continue after removal commits; wrap the restoration load in the account lease and revalidate the exact session, as the main sync worker does.
AGENTS.md reference: AGENTS.md:L327-L329
Useful? React with 👍 / 👎.
| internal fun scheduleRestorationFailureDisposition(runAttemptCount: Int): BackgroundSyncWorkerDisposition { | ||
| require(runAttemptCount >= 0) | ||
| return BackgroundSyncWorkerDisposition.Retry |
There was a problem hiding this comment.
Stop retrying permanent schedule-restoration failures
When schedule restoration encounters a permanent failure such as an unauthorized session or malformed file-sync state, the broad failure path reaches this helper and returns Result.retry() for every runAttemptCount, so the one-time WorkManager job continues waking and repeating authenticated discovery indefinitely. Classify permanent versus transient outcomes, and apply a bounded retry budget rather than ignoring the attempt count.
AGENTS.md reference: AGENTS.md:L281-L283
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8c329d505
ℹ️ 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".
Outcome
Advances #172. This PR depends on #429.
Latest review revision
Commit
eadef3dc989977bcb507865ed2bfb6743f9e9136fixes DocumentsProvider metadata lookups reacquiring the non-reentrant account lease already held by rename, delete, move, and nested-create operations. Ordinary file reads still acquire and validate their own lease. Focused regressions cover held-lease lookups, stale ordinary reads, cache/error/cancellation behavior, and parent-directory validation.One correctness finding remains open: malformed account-removal cleanup journals can block all account activation without a usable in-app recovery flow. An entry may contain no recoverable ownership identity. Ignoring it could revive pending-delete private state, while a blanket purge could erase offline files or drafts. No automatic journal discard or private-data purge has been added; recovery policy and explicit user consent need a maintainer decision before merge.
Validation
31c7c7e2458c3aaf0f78568e122cb951742d7642.Compatibility and evidence limits
Android and desktop JVM targets are affected. No device, emulator, live Nextcloud server, macOS keychain, Windows Credential Manager, or Linux Secret Service end-to-end verification is claimed for this revision. Corrupt, mismatched, and unsupported credential state remains fail-closed rather than being overwritten.
No visual changes in the provider-deadlock revision.