Repository navigation
Conversation
Contributor
Code Metrics Report
Details | | main (589a66f) | #601 (2a32049) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 88.7% | 88.7% | +0.0% |
| Files | 208 | 208 | 0 |
| Lines | 6282 | 6284 | +2 |
+ | Covered | 5574 | 5576 | +2 |
+ | Test Execution Time | 2m21s | 2m14s | -7s |Code coverage of files in pull request scope (100.0% → 100.0%, patch 100.0%)
Reported by octocov |
IzumiSy
marked this pull request as ready for review
October 13, 2026 03:56
Contributor
Author
|
/review |
Contributor
|
✅ Code Review completed successfully! Code review complete for PR #601 - no actionable High/Medium issues found in changed packages/core attachment hook behavior, and this workflow does not expose a general PR comment tool for approval-only reviews.
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The ownership-based cleanup is correct, narrowly scoped, and covered by relevant lifecycle tests.
0 open findings
What changed in this PR
Fixes Blob URL leaks by tracking attachment previews independently from buffered operations.
Changes:
- Reclaims pending and applied previews on unmount.
- Prevents double revocation after deletion.
- Adds regression tests and a patch changeset.
| File | Description |
|---|---|
use-attachment.ts |
Tracks and releases hook-owned preview URLs. |
use-attachment.test.ts |
Tests cleanup across apply, delete, and unmount. |
.changeset/tidy-otters-rest.md |
Documents the patch release. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
interacsean
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
useAttachmentretains image previews after a successfulapplyChanges()call, but clears the corresponding buffered upload operations. Its unmount cleanup previously read only that operation buffer, so successfully applied images no longer had their Blob URLs reclaimed when the hook unmounted.This extracts the Attachment cleanup from #525 into an independent, small bug-fix PR based on
main. It does not depend on the test-cleanup PR or include the lint upgrade and other state-ownership changes.Design Decision
Track preview lifetime separately from pending operations
Keep a registry of Blob URLs created by this hook. Successful applies leave the previews usable, deletion releases and removes a URL, and unmount releases the remaining registered URLs. Caller-supplied initial URLs are not registered for unmount cleanup.
The existing operation buffering, rollback, and concurrent-flush behavior remain unchanged. No public API changes are needed.
Summary