Skip to content
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

fix(core): handle multiple messages #17199

Merged
merged 1 commit into from
May 24, 2023

Conversation

wSedlacek
Copy link
Contributor

@wSedlacek wSedlacek commented May 24, 2023

Current Behavior

Currently the file watcher for the @nx/js:node executor can fail to read messages when they occur too quickly (rapidly saving)
The error is

Watch error: Unexpected token  in JSON at position 157

The data it is trying to parse is

"{\"changedProjects\":[\"standard-json-schema\"],\"changedFiles\":[{\"path\":\"libs/shared/util-std-json-schema/src/lens-schema/lens-schema.util.ts\",\"type\":\"update\"}]}\u0004{\"changedProjects\":[\"standard-json-schema\"],\"changedFiles\":[{\"path\":\"libs/shared/util-std-json-schema/src/lens-schema/lens-schema.util.ts\",\"type\":\"update\"}]}\u0004{\"changedProjects\":[\"standard-json-schema\"],\"changedFiles\":[{\"path\":\"libs/shared/util-std-json-schema/src/lens-schema/lens-schema.util.ts\",\"type\":\"update\"}]}\u0004{\"changedProjects\":[\"standard-json-schema\"],\"changedFiles\":[{\"path\":\"libs/shared/util-std-json-schema/src/lens-schema/lens-schema.util.ts\",\"type\":\"update\"}]}"

This is two messages with a 0004 between.

Expected Behavior

The file watcher should not get errors when too many messages occur at once.

Related Issue(s)

A similar change was reverted in 6448274, is there another solution to this issue?

@vercel
Copy link

vercel bot commented May 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev 🛑 Canceled (Inspect) May 24, 2023 8:51pm

@wSedlacek wSedlacek force-pushed the hotfix/parse-multiple-messages branch from c2cf593 to c79bdc4 Compare May 24, 2023 19:59
@wSedlacek wSedlacek force-pushed the hotfix/parse-multiple-messages branch from c79bdc4 to dd01e6d Compare May 24, 2023 20:00
Copy link
Member

@AgentEnder AgentEnder left a comment

Choose a reason for hiding this comment

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

Looks good, can you run format?

@AgentEnder AgentEnder merged commit c57f7b8 into nrwl:master May 24, 2023
@wSedlacek wSedlacek deleted the hotfix/parse-multiple-messages branch May 24, 2023 22:27
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 30, 2023
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.

2 participants