Repository navigation
fix(keystatic): refresh collection list view after saving or deleting an entry (#1633) - #1662
Open
thinhnx128 wants to merge 1 commit into
Open
thinhnx128 wants to merge 1 commit into
thinhnx128 wants to merge 1 commit into
Conversation
…entry save (Thinkmill#1633) Ensure saving or deleting an entry immediately updates the active branch tree SHA and hydrates the tree cache for the new commit tree OID (including after STALE_DATA retries), and include configured collection columns in CollectionPage search filtering. Fixes Thinkmill#1633 Signed-off-by: Xuan Thinh <thinhnx128@gmail.com>
🦋 Changeset detectedLatest commit: 114d632 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
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.
Summary
Refreshes the Git tree state and invalidates cached collection item data in
@keystatic/coreafter saving or deleting an entry so thatCollectionPageimmediately reflects newly created, updated, or deleted items upon navigation.Root Cause
In local storage mode,
updateBranchWithChangespersisted file mutations via/api/keystatic/updatewithout triggering a subsequent/api/keystatic/treerevalidation, leavingBranchInfoContext.currentTreeandCollectionPageitem caches stale until a full browser reload.Changes
packages/keystatic/src/app/shell/data.tsx: exposerefreshCurrentTreeonBranchInfoContextand invalidateentryDataCache/blobCacheentries when blob SHAs change.packages/keystatic/src/app/updating.tsx: invokerefreshCurrentTreeafter local commits and deletes complete.packages/keystatic/src/app/CollectionPage.tsx: include each itemshain the cached loader key so updated entries reload automatically.packages/keystatic/src/app/trees.test.ts: add unit test verifying tree digest updates when an entry blob SHA changes..changeset/refresh-collection-list-after-save.md: add patch changeset for@keystatic/core.Testing
pnpm --filter @keystatic/core test packages/keystatic/src/app/trees.test.tsFixes #1633