Skip to content

Conversation

@shekhar566
Copy link

What

Renamed the fetchEntitySnapshot method to fetchAndCacheEntitySnapshot in the EventStore class 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 fetchEntitySnapshot was 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

  • Renamed fetchEntitySnapshotfetchAndCacheEntitySnapshot in packages/core/src/services/event-store.ts
  • Updated all usages (BoosterDataMigrations, tests, etc.)
  • Updated the FAQ documentation mentioning the method name

Checks

  • Project Builds
  • Project passes tests and checks
  • Updated documentation accordingly

Thank you for maintaining this awesome project! 🙌

@what-the-diff
Copy link

what-the-diff bot commented Nov 6, 2025

PR Summary

  • Method Name Update
    The name of a previously-used method called fetchEntitySnapshot has been updated to fetchAndCacheEntitySnapshot. This change better reflects the method's functionality and will occur in various places throughout the program.

  • Process Enhancement
    Processes in BoosterDataMigrations, BoosterEventProcessor, and Booster have been adjusted to use the new fetchAndCacheEntitySnapshot method. This change optimizes these processes by ensuring they are using the method that more accurately represents their function.

  • Test Adjustments
    To coincide with the previous changes, all relevant tests were updated accordingly. This was done to ensure that the tests accurately reflect the updated method name and its associated functionalities.

  • Documentation Update
    For the sake of clarity, the documentation has been updated to reflect the change from Booster.fetchEntitySnapshot to Booster.fetchAndCacheEntitySnapshot. This will help lessen the room for possible misunderstandings for users following video guides.

@javiertoledo javiertoledo requested a review from Copilot November 6, 2025 13:20
Copy link
Contributor

Copilot AI left a 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() to EventStore.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.
Copy link

Copilot AI Nov 6, 2025

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.

Suggested change
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`.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant