-
Notifications
You must be signed in to change notification settings - Fork 99
refactor(core): rename fetchEntitySnapshot to fetchAndCacheEntitySnapshot for clarity and update FAQ documentation #1590
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?
Conversation
…shot for clarity and update docs
PR Summary
|
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 renames the internal method fetchEntitySnapshot to fetchAndCacheEntitySnapshot in the EventStore class to better reflect its functionality of both fetching and caching entity snapshots.
Key changes:
- Renamed
EventStore.fetchEntitySnapshot()toEventStore.fetchAndCacheEntitySnapshot()across all source files - Updated all test files to use the new method name
- Updated documentation to reflect the method name change
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
website/docs/11_frequently-asked-questions.md |
Updates FAQ to reference the new method name (contains documentation issue) |
packages/framework-core/src/services/event-store.ts |
Renames the method and updates its logger identifier |
packages/framework-core/src/booster.ts |
Updates call to renamed EventStore method |
packages/framework-core/src/booster-event-processor.ts |
Updates call to renamed EventStore method |
packages/framework-core/src/booster-data-migrations.ts |
Updates call to renamed EventStore method |
packages/framework-core/test/services/event-store.test.ts |
Updates all test cases to use the new method name |
packages/framework-core/test/booster.test.ts |
Updates test mocks and expectations for the renamed method |
packages/framework-core/test/booster-event-processor.test.ts |
Updates test stubs and expectations for the renamed method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| **2.- I tried following the video guide but the function `Booster.fetchAndCacheEntitySnapshot` is not found in BoostApp.** | ||
|
|
||
| The function `Booster.fetchEntitySnapshot` was renamed to `Booster.entity`, so please replace it when following old tutorials. | ||
| The function `Booster.fetchAndCacheEntitySnapshot` was renamed to `Booster.entity`, so please replace it when following old tutorials. |
Copilot
AI
Nov 6, 2025
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.
The documentation update is inconsistent with the actual API. fetchAndCacheEntitySnapshot is an internal method of the EventStore class, not a public method of the Booster class. The original FAQ referred to Booster.fetchEntitySnapshot, which should remain unchanged in the documentation since the public API Booster.entity has not changed. The internal refactoring of EventStore.fetchEntitySnapshot to EventStore.fetchAndCacheEntitySnapshot should not affect this user-facing documentation.
| The function `Booster.fetchAndCacheEntitySnapshot` was renamed to `Booster.entity`, so please replace it when following old tutorials. | |
| The function `Booster.fetchAndCacheEntitySnapshot` is not part of the public API. The correct way to fetch an entity snapshot is to use the public method `Booster.entity`. If you see references to `fetchEntitySnapshot` or `fetchAndCacheEntitySnapshot` in old tutorials, please replace them with `Booster.entity`. |
What
Renamed the
fetchEntitySnapshotmethod tofetchAndCacheEntitySnapshotin theEventStoreclass to make it clear that this method also caches updated snapshots after fetching them.Also updated all references across the codebase and fixed documentation in the FAQ to reflect the new name.
Why
The previous name
fetchEntitySnapshotwas slightly misleading because it implied that the method only fetched entity snapshots. However, it also caches updated snapshots for faster subsequent access. The new name improves clarity and developer understanding.How
fetchEntitySnapshot→fetchAndCacheEntitySnapshotinpackages/core/src/services/event-store.tsBoosterDataMigrations, tests, etc.)Checks
Thank you for maintaining this awesome project! 🙌