Skip to content

fix(android): preserve queued upload scheduling - #439

Open
veryCrunchy wants to merge 54 commits into
fix/account-background-isolationfrom
fix/durable-upload-scheduling-recovery-stack
Open

fix(android): preserve queued upload scheduling#439
veryCrunchy wants to merge 54 commits into
fix/account-background-isolationfrom
fix/durable-upload-scheduling-recovery-stack

Conversation

@veryCrunchy

@veryCrunchy veryCrunchy commented Sep 1, 2026

Copy link
Copy Markdown
Member

Outcome

Preserve durable attachment uploads when WorkManager accepts a job but its completion signal fails. Keep the journal and source ownership so startup and status restoration can recover the same upload without submitting a duplicate.

Recovery now also:

  • defers transient credential and source failures while rejecting permanently unavailable sources;
  • preserves per-job retry deadlines when status refreshes or unrelated recovery requests arrive;
  • retries terminal source cleanup independently of network availability;
  • quarantines malformed capability records without deleting another job's grant;
  • rejects reuse of a permission still owned by malformed metadata;
  • bounds persisted capability storage before loading preferences and stops retrying quarantined cleanup indefinitely.

Cancellation after persistence remains cancellation. A source is released only when the queue can prove that no active job owns it.

Validation

The preceding recovery revision passed on the dedicated Linux build host at source tree f26d5d41b6b6fe167a0b2138f806611e29be4503:

  • 145 focused Android unit tests, with no failures or skips, covering upload policy, scheduling recovery, source preflight, terminal cleanup, capability lifecycle, cleanup pruning, and oversized storage recovery.
  • :androidApp:assembleDebug.
  • bash tools/check-repository.sh and git diff --check.

The latest revision also stops permanently retrying cleanup blocked by malformed peer metadata. Ambiguous non-preexisting grants remain quarantined. Proven preexisting grants use metadata-only removal without revoking another owner's grant. Three regression tests cover these cases.

Head 50db150461553e227b19907d7b0f2ea7ecec74e1 includes main at 92dd2ae9cec1dc7dac16907e66d7b870694ebbbf and the parent provider-deadlock fix. All 49 layer commits retained identical patches during the latest restack. Full repository checks and git diff --check passed. The new regression tests and inherited deadlock fix have not yet received direct build-host validation because the host stopped responding during another capture job. Hosted checks on this head are pending; the earlier 145-test result does not cover these newest changes.

Limits and dependency

Deterministic tests and APK assembly do not prove emulator lifecycle behavior, a live Nextcloud attachment upload, or fault injection inside Android's real WorkManager database. Those checks were not performed for this revision.

This PR builds on #438, which owns the adjacent account-isolated queued credential lookup.

Advances #52

@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 1, 2026 21:15 Destroyed
@obiente-cloud

obiente-cloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

Obiente preview

NC Native · ce1c82ae557c · Ready

Open preview

View in Obiente

Obiente updates this comment as the preview changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-09-04T21:39:40.762081Z 84c8005 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 1, 2026 21:17 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 454d73b427

ℹ️ 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".

@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from e2a8728 to d4e541c Compare September 1, 2026 21:54
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 1, 2026 21:54 Destroyed
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 1, 2026 22:31 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from 4482b93 to c2f0cc7 Compare September 3, 2026 20:43
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 3, 2026 20:43 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from c2f0cc7 to 84677b8 Compare September 3, 2026 20:54
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 3, 2026 20:54 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84677b8a69

ℹ️ 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".

@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from 84677b8 to abcbb66 Compare September 3, 2026 21:18
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 3, 2026 21:19 Destroyed
@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from abcbb66 to 7b2e575 Compare September 3, 2026 21:43
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 3, 2026 21:43 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b2e575cd6

ℹ️ 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".

@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from 7b2e575 to a86e5ec Compare September 4, 2026 00:39
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 4, 2026 00:39 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a86e5ec1fa

ℹ️ 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".

@veryCrunchy
veryCrunchy force-pushed the fix/durable-upload-scheduling-recovery-stack branch from a86e5ec to 3ed84f8 Compare September 4, 2026 01:10
@obiente-cloud
obiente-cloud Bot temporarily deployed to Obiente Preview / PR #439 / NC Native September 4, 2026 01:10 Destroyed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50db150461

ℹ️ 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".

}
monitorQueuedDurableUploadScheduling(
recover = {
keepRetryingQueuedDurableUploadScheduling(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Let the monitor consume failures during recovery retries

When any unrelated reconciliation condition keeps returning false, such as a picker cleanup that remains temporarily unavailable, this nested keepRetryingQueuedDurableUploadScheduling call never returns control to the outer monitor. A worker-failure request has already placed that job in backedOffWorkIds, but because its batch is never consumed, every periodic reconciliation skips the job via scheduleUnlessBackedOff and its deadline is never retired; the upload can therefore remain queued indefinitely behind the unrelated failure. Fresh evidence beyond the earlier backoff comments is that the final application wiring nests the uninterruptible retry loop inside the sole signal consumer; make these waits signal-aware or return after each retry cycle.

AGENTS.md reference: AGENTS.md:L457-L459

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant