-
Notifications
You must be signed in to change notification settings - Fork 12
Add FileDef GC coverage #3894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add FileDef GC coverage #3894
Conversation
2d5f130 to
f42e772
Compare
Preview deployments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends the garbage collection (GC) mechanism in CardStoreWithGarbageCollection to include FileDef instances, which previously only participated in storage but not in GC and reference counting.
Changes:
- Renamed internal variables from "card" terminology to "instance" terminology to reflect that the maps now store both CardDef and FileDef instances
- Updated the
sweepmethod to handle FileDef instances separately from CardDef instances, since FileDef doesn't participate in the dependency graph - Enhanced the
hasReferencesmethod to work with both localIds (for CardDef) and remote URLs (for FileDef)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/host/tests/integration/store-test.gts | Added two test cases verifying that FileDef instances are retained when referenced and garbage collected when references drop |
| packages/host/app/lib/gc-card-store.ts | Extended GC logic to handle FileDef instances, renamed variables for clarity, and updated hasReferences to work with both card and file identifiers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f42e772 to
cc712af
Compare
| #nonTrackedInstances = new Map<string, StoredInstance>(); | ||
| #nonTrackedInstanceErrors = new Map<string, CardErrorJSONAPI>(); | ||
|
|
||
| #cards = new TrackedMap<string, StoredInstance>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be consistent we should probably rename this to instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i noticed u didn't change this--was that an oversight?
cc712af to
74c2cf2
Compare
CardStoreWithGarbageCollection, but GC and reference counting only consider cards.This PR creates the following behavior: