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
There is a mistake in the stricness of onWritable return checks. It really only checks if onWritable returns empty or non-empty, while the real check should be if it returns a boolean or or not. The return value of onWritable must be nothing but a boolean.
This check should also have a nice, clear error message like the others we have for the 2 other checks.
The text was updated successfully, but these errors were encountered:
Returning false in onWritable is an optimization where the lib won't perform an extra attempt at sending, since false means the user just sent something themselves and failed. This means that all other returns than false, will try and drain the backpressure. This whole feature should be better documented to explain why onWritable wants boolean.
We should accept Promise, Boolean and only warn on empty return. Currently it errors with an ugly message on empty return.
uNetworkingAB
changed the title
Add stricter onWritable return checks and errors
Better onWritable documentation, and more user friendly warning on ill-use.
May 29, 2023
There is a mistake in the stricness of onWritable return checks. It really only checks if onWritable returns empty or non-empty, while the real check should be if it returns a boolean or or not. The return value of onWritable must be nothing but a boolean.
This check should also have a nice, clear error message like the others we have for the 2 other checks.
The text was updated successfully, but these errors were encountered: