You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "testikun (via GitHub)" <gi...@apache.org> on 2026/10/19 10:03:51 UTC

[PR] fix(storage): preserve images across session bundle imports [maka]

testikun opened a new pull request, #6167:
URL: https://github.com/apache/maka/pull/6167

   ## Summary
   
   Session bundle imports can report success with an unreadable image, retain image references after runtime rollback, or delete attachments after a successful commit. Importing a managed-file image over a legacy inline blob can also leave a file that GC cannot reclaim.
   
   - Reject conflicts on either context-reference uniqueness key and validate snapshots against the actual Context Store schema before publishing them.
   - Retire references for unpublished Sessions after a caught failure, preserve committed attachments, and adopt managed payloads when deduplicating against inline blobs.
   - Cover image readability, shared-blob accounting, GC, retries, and publication failures; seed runtime import fixtures through the real context writer.
   
   Fixes #6166
   
   The failure cleanup applies after the context merge returns successfully. Recovery from process termination or power loss between database commits requires separate work.
   
   ## Verification
   
   - `npm run lint`, `npm run format:check`, `npm run build`, and `npm run typecheck`: passed.
   - `npx knip --workspace apps/desktop` and `npx knip --workspace packages/ui`: passed.
   - Storage suite: **1,692 passed, 8 skipped, 0 failed**.
   - Runtime Session import/export integration: **59 passed**.
   - The 15 regression cases include all four inline/managed-file combinations. Removing the four new protections reproduces 11 failures; removing the inline-to-managed promotion reproduces the remaining file leak. Restoring the fixes passes all cases.
   
   Before cleanup, the failed-import reproduction retains `{ references: 1, logicalBytes: 65536, physicalBytes: 65536 }` despite having no imported Session. After cleanup and GC, all three values are zero; another Session sharing the image remains readable. The post-commit fault injection previously produced `ENOENT` for a published attachment and now preserves its content.
   
   Full monorepo tests and power-loss recovery tests were not run; the affected storage suite and runtime import/export integration were run against compiled output.
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: OpenAI Codex assisted with investigation, implementation, regression tests, and this PR description. The commit includes a `Generated-by: OpenAI Codex` trailer.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(storage): preserve images across session bundle imports [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on PR #6167:
URL: https://github.com/apache/maka/pull/6167#issuecomment-6312518762

   Thanks for preserving images and references during session imports and for the regression coverage. The reviewed head `fbbb15b228006e3c1b05ab6c964d675ce529c7c6` is unchanged, its test checks pass, and it merges cleanly with current main. I am proceeding with the merge at Astro-Han's explicit request.
   
   > **Automated review notice:** This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(storage): preserve images across session bundle imports [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #6167:
URL: https://github.com/apache/maka/pull/6167


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org