Skip to content

fix: Export PersistentDataStoreWrapper. #144

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

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

kinyoklion
Copy link
Member

fix: Fix a bug in the UpdateQueue, used for persistence, which would prevent tasks from executing correctly.
fix: Update package.json to use --topological-dev when building workspaces. This will ensure packages which have devDependencies on each other, are built in correct order. Currently only "dependencies" affect build order. This will affect store packages because they use a peer+dev dependency on the SDK they are associated with.

@@ -86,8 +86,6 @@ function deserialize(
* instance of {@link PersistentDataStore}. It provides optional caching behavior and other logic
* that would otherwise be repeated in every data store implementation. This makes it easier to
* create new database integrations by implementing only the database-specific logic.
*
* @internal
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be used by persistent store packages.

@@ -22,12 +22,13 @@ export default class UpdateQueue {
// count could hit 0, and overlapping execution chains could be started.
this.queue.shift();
// There is more work to do, so schedule an update.
if (this.enqueue.length > 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug, enqueue is a function. The function has 2 parameters, so its length is 2. Which caused the queue to always trigger a task update.

This caused multiple execution of tasks, as well as failing to dispatch other tasks.

import { deserializePoll } from './serialization';

export { AsyncStoreFacade, deserializePoll };
export { AsyncStoreFacade, PersistentDataStoreWrapper, deserializePoll };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exporting to be used in persistent store packages.

@kinyoklion kinyoklion merged commit 2c2480d into main Jun 8, 2023
@kinyoklion kinyoklion deleted the rlamb/update-exports-for-persistence branch June 8, 2023 16:01
@github-actions github-actions bot mentioned this pull request Jun 8, 2023
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.

2 participants