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: Don't require _every_ message to contain procedure information #32

Merged

Conversation

lhchavez
Copy link
Contributor

@lhchavez lhchavez commented Dec 13, 2023

Previously we had the requirement that every single message in a stream had to have the service name + procedure. But that's very wasteful and also kind of awkward to be saving in other implementations.

This change does a little refactor so that the server no longer relies on having this information in every message in a stream. In doing this refactor, we also now can reason about what the first message is, and can now correctly validate that the initialization message is received first and then all future messages only comply with the regular input type. Also fixed a bug where an overly zealous listener would incorrectly close all streams upon the first close message.

Do yourself a favor and review this with whitespace turned off.

router/client.ts Show resolved Hide resolved
router/server.ts Outdated Show resolved Hide resolved
transport/message.ts Outdated Show resolved Hide resolved
router/client.ts Outdated Show resolved Hide resolved
@lhchavez lhchavez force-pushed the lh-fix-dont-require-all-messages-to-contain-proc-info branch from 656c928 to 0644b6b Compare December 13, 2023 18:38
Previously we had the requirement that every single message in a stream
had to have the service name + procedure. But that's very wasteful and
also kind of awkward to be saving in other implementations.

This change does a little refactor so that the server no longer relies
on having this information in every message in a stream. In doing this
refactor, we also now can reason about what the first message is, and
can now correctly validate that the initialization message is received
first and then all future messages only comply with the regular input
type. Also fixed a bug where an overly zealous listener would
incorrectly close all streams upon the first close message.
@lhchavez lhchavez force-pushed the lh-fix-dont-require-all-messages-to-contain-proc-info branch from 0644b6b to 189b26c Compare December 13, 2023 18:47
@lhchavez lhchavez merged commit d71f9da into main Dec 13, 2023
4 checks passed
@lhchavez lhchavez deleted the lh-fix-dont-require-all-messages-to-contain-proc-info branch December 13, 2023 19:19
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