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

Messages in jsonrpc are not processed according to enqueue order #1596

Open
nieyuyao opened this issue Dec 24, 2024 · 0 comments
Open

Messages in jsonrpc are not processed according to enqueue order #1596

nieyuyao opened this issue Dec 24, 2024 · 0 comments

Comments

@nieyuyao
Copy link

nieyuyao commented Dec 24, 2024

i am using the latest jsonrpc to fix an issue with volar. i found that messages are sometimes not processed according to the order of messageQueue.
the relevant code is as follows

} finally {
	if (result instanceof Promise) {
		result.then(() => {
			inFlight--;
			triggerMessageQueue();
		}).catch((error) => {
			logger.error(`Processing message queue failed: ${error.toString()}`);
		});
	} else {
		inFlight--;
	}
	triggerMessageQueue();
}	

it seems that the last triggerMessageQueue statement should not be executed when the previous result is a Promise.

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

No branches or pull requests

1 participant