You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered some mysterious behavior while using BlockDecoder. If the header is invalid (!tap.isVaid()), the stream does not raise an error event. Instead, it just returns.
This was confusing, because I was expecting an error event that I could process. I can work around this by listening for the "metadata" event and storing the parsed schema in a variable then testing to see if this variable is defined when the stream ends.
I'm not sure if this is intended behavior, but I would prefer if any invalid input would raise an error that can be handled rather than silently completing.
The text was updated successfully, but these errors were encountered:
Agreed that it's surprising behavior for the stream to not emit an error if it is ended without a valid header. (Until that happens, the tap.isValid return on failed check is expected: it just means the header is missing data.)
Until this is fixed, your workaround sounds right. To contain complexity on your end (and make migration easier later on) you could isolate the logic in a thin factory function. Something like (untested):
I discovered some mysterious behavior while using
BlockDecoder
. If the header is invalid (!tap.isVaid()
), the stream does not raise an error event. Instead, it just returns.This was confusing, because I was expecting an error event that I could process. I can work around this by listening for the
"metadata"
event and storing the parsed schema in a variable then testing to see if this variable is defined when the stream ends.I'm not sure if this is intended behavior, but I would prefer if any invalid input would raise an error that can be handled rather than silently completing.
The text was updated successfully, but these errors were encountered: