Repository navigation
Preserve concrete error causes across Journal boundaries - #149
Conversation
Codex Review Summary: ✅ CompletedThis 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: 528854e761
ℹ️ 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".
| if not t.closed && current () then | ||
| (try t.on_asset_diagnostic ~scope:request.context.scope ~operation | ||
| ~request_operation:request.operation detail with _ -> ()); | ||
| Error (Core.asset_failure_with_cause failure detail) |
There was a problem hiding this comment.
Unwrap asset failures before applying local-cache fallbacks
Static inspection shows that wrapping every non-cancellation failure here breaks the existing constructor matches in logseq_db_worker/lib/effect_runner/effect_runner.ml's lookup_local_asset: Error Sync.Asset_storage_full no longer returns the retained staging lease, and Error (Sync.Asset_missing_source | Asset_checksum_mismatch) no longer becomes a cache miss. Consequently, a locally imported attachment becomes unavailable when cache publication runs out of space despite its staging file remaining readable; missing or corrupt staged content also prevents the Local_and_remote path from falling back to the remote cache. Match these failures through asset_failure_kind before introducing the wrapper.
Useful? React with 👍 / 👎.
Summary
Preserve concrete error causes across storage, Worker, sync, coordination, application diagnostics, and the native bridge.
listTimelineDatesnow retains distinct database-closed, released-snapshot, and invalidated-generation origins. Queue pressure remainsqueueFull/storageBusyinstead of becomingclosedSession.A pre-existing macOS build blocker was also fixed with a platform guard around
listSectionSpacing(16). Its iOS behavior is unchanged.Review follow-up: local asset fallback
Addressed the asset-wrapper review in ed22c21.
asset_failure_kindwhile preserving the original wrapped error and diagnostic. Full cache retains its staging lease; missing/corrupt staging releases exactly once and falls back to remote cache.Validation
dune build @all app/native_embed.exe.o: passed on final source.dune runtest --force: passed on final source, including 1,315 Alcotest cases across 22 suites plus custom contract/helper checks. Localhost DNS/TLS fixtures require execution outside the command sandbox; the identical focused binary failed there and passed with the approved local-network access.spec-dev-tool check --all: six unchanged, pre-existing document-format failures. Output is byte-identical to the initial baseline check; no unrelated documents changed.Audit boundaries
This is a repository-wide audit and propagation repair, not a claim that every legacy error contract now carries a complete causal object.
unit, strings, or nullary variants: snapshot-activation cancellation, authoritative cursor/checksum mismatch, Worker settlement/recovery, and upload invalid-content. These need separately scoped contract changes to preserve richer structured context.closedSessionlabel. This change preserves distinctions for subsequent failures; it does not assert which of them occurred then.