Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Fixed duplicated events issue #303

Merged
merged 5 commits into from
Oct 22, 2021
Merged

Conversation

mattpocock
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2021

🦋 Changeset detected

Latest commit: 01bb94b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
xstate-viz-app Patch

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

@vercel
Copy link

vercel bot commented Oct 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/statelyai/xstate-viz/FpL6zes6kgduz3qGSBpDjq1HoF4w
✅ Preview: https://xstate-viz-git-matt-fixed-duplicated-events-issue-statelyai.vercel.app

@@ -68,38 +68,6 @@ export const simulationMachine = simModel.createMachine(
? 'inspecting'
: 'visualizing',
entry: assign({ notifRef: () => spawn(notifMachine) }),
invoke: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This service appears to do nothing, other than duplicate events received by the machine. Removing it means inspect still works, and the visualisation still works. @Andarist @farskid have I missed something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or is this for visualisations done inside the app during development?

Copy link
Member

Choose a reason for hiding this comment

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

Does spawning/invoking machines still work? I think that's what this was for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, it didn't! Have now made it so it only reports from interpreters that have a parent - i.e. ONLY child machines/invocations

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not familiar with this part but probably @Andarist does

Copy link
Member

@davidkpiano davidkpiano left a comment

Choose a reason for hiding this comment

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

Good fix, the logic makes sense! Just added a note for us in the future

Comment on lines +257 to +264
events: (ctx, e) => {
return produce(ctx.events, (draft) => {
draft.push({
...e.state._event,
timestamp: Date.now(),
sessionId: e.sessionId,
});
}),
});
Copy link
Collaborator

@farskid farskid Oct 22, 2021

Choose a reason for hiding this comment

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

This looks to be an unnecessary change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, it's only formatting though

@farskid farskid self-requested a review October 22, 2021 13:45
Co-authored-by: David Khourshid <davidkpiano@gmail.com>
@mattpocock mattpocock merged commit b377410 into dev Oct 22, 2021
@mattpocock mattpocock deleted the matt/fixed-duplicated-events-issue branch October 22, 2021 13:57
@github-actions github-actions bot mentioned this pull request Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants