fix(android): bind retained documents to accounts - #447
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: f97f74994f
ℹ️ 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".
a80069c to
722eb39
Compare
00333f6 to
8266aab
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8266aabbc2
ℹ️ 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: e6b7830d96
ℹ️ 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: 888fbf8e00
ℹ️ 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".
dfdae5f to
871e131
Compare
888fbf8 to
74b43bf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74b43bf122
ℹ️ 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".
a10ff29 to
5bd8032
Compare
74b43bf to
b1fc365
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1fc365e26
ℹ️ 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: 904fa387ba
ℹ️ 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".
904fa38 to
8f53cf8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f53cf8e18
ℹ️ 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".
e17cca5 to
8a804d3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a804d331c
ℹ️ 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".
| private fun NextcloudAccountRecord.documentAccountKeys(): Set<String> = | ||
| setOf(canonicalDocumentAccountKey(), NextcloudDocumentIds.accountKey(serverUrl, loginName)) |
There was a problem hiding this comment.
Retain prior raw keys for legacy document IDs
When an upgraded account has an nc1 document grant created before this change and is later reauthenticated with a canonically equivalent server spelling, this set contains only the canonical key and the replacement record's raw digest. The old raw digest is therefore unmatched, so requireAccount() rejects the retained document even though accountId and the account incarnation are unchanged. The fresh evidence after the earlier report is that the final resolver retains only the current raw digest rather than preserving or migrating the historical legacy alias.
AGENTS.md reference: AGENTS.md:L410-L411
Useful? React with 👍 / 👎.
| val rootIds = listOf( | ||
| NextcloudDocumentIds.rootId(accountIdentity, NextcloudDocumentIncarnation.Legacy), | ||
| NextcloudDocumentIds.rootId(accountIdentity, retired), |
There was a problem hiding this comment.
Revoke grants using the emitted canonical root ID
When account removal cleans up a grant created by this version, callers pass the legacy raw NextcloudDocumentIds.accountKey(session) as accountIdentity, but providerRootId(), documentId(), and rootId(session, ...) now emit the canonical accountId.storageKey.take(32) key. Constructing both retirement roots from the raw key means revokeUriPermission() never targets the actual canonical legacy or versioned URI, leaving the persisted Android grant installed after removal; build the incarnation root from accountStorageKey while retaining the raw form only for pre-migration grants.
AGENTS.md reference: AGENTS.md:L359-L364
Useful? React with 👍 / 👎.
Summary
Validation
The earlier source tree
c9a314df55e510df3f1478288955c06c5223e3aapassed the focused eight-class Android provider/removal suite and:androidApp:assembleDebugon the dedicated build host.Current head
8a804d331cd31b78bedccf29a2cc63d1e1017911adds reset quiescence, canonical IDs, and short-read lease regressions, then integrates the parent provider-deadlock fix. Full repository and architecture checks andgit diff --checkpass. File-size baselines only decreased.The new tests and integrated revision have not yet received direct build-host validation because SSH to that host is unavailable. Hosted checks on this pushed head are pending. The earlier test result does not cover the newest changes.
Dependency and limits
This PR is stacked on #436 and includes
mainat92dd2ae9cec1dc7dac16907e66d7b870694ebbbf. No live Android document-provider lifecycle or external-client test is claimed.