-
-
Notifications
You must be signed in to change notification settings - Fork 171
fix: fix streambundle error after port to TypeScript #1945
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
Conversation
a6a19af
to
6b5806c
Compare
I can’t think of a use case for |
Just don't forget about meta deltas, where "values" may be undefined. |
6b5806c
to
ec7d088
Compare
This and #1942 seemed to fix recently seen problems. |
It is meta causing this issue . Added try-catch to collect deltas and here is small piece of the log throwing error.
|
28825dd
to
4833dcb
Compare
4833dcb
to
4e4fcd0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can’t think of a use case for values not being an array, so i would rather implement a check-and-discard in handleMessage so that downstream one can expect valid data.
Sounds good, I updated handleMessage
. I tried adding some tests for this behavior, but adding unit tests was going to require some refactoring that belongs in a pull request of its own.
|
||
// No valid updates, discarding | ||
if (data.updates.length < 1) return | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier's 80 char line limit is so annoying. Most of these changes are because line 282 is now just over 80 characters, and now it's hard to see what else I actually changed. Anyone opposed to changing it to 100 characters?
Here's a link to view the diff without whitespace changes
This fixes an error reported by @KEGustafsson introduced in #1918. I have not been able to recreate it, but apparently there are instances where
update.values
is present, but is not an array. Looking back at #1918, it looks like the old code did have anif
conditional, so there must be instances where it isnull
/undefined
.I updated the types to be consistent with the implementation as well.While I was looking at that, I noticed that
app
is injected into stream bundle, but is unused, so I removed it in another commit.