Gil Pedersen

Results 191 comments of Gil Pedersen

@hardnold Glad this can make some sense. This is probably mostly an issue for legacy code that relies on the buggy behavior. Any chance you want to create a PR...

Hmm, we already test for errors during stream transmission, but not combined with a client abort. Guess we need another test case.

Actually, this does not make sense. The `internals.end()` method is called to handle the request `'aborted'` event and then proceeds to call `res.end()`. Response will have the `res.finished === false`,...

@aaestrada If you can reliably reproduce the issue, please file an issue.

Regardless of what triggers this, hapi should probably handle thrown errors when calling `request.raw.res.end()`.

I caught it during my recent investigations into abort handling. Here I found that `autoValue` is unintentionally called twice when it returns an error, since it calls it again when...

So I haven't given much credence to this, beyond listing some of the stuff we could possibly use with this. I will try to find some concrete examples of how...

"Optional chaining" can simplify existing code wherever we use the pattern `object && object.property`. This can in most cases be rewritten as the more succinct `object?.property`. Eg. here: https://github.com/hapijs/hapi/blob/c2107e9bc9c522c3778e90a3629a0c84f776f9fe/lib/core.js#L607

"Private class methods" allows us to hide methods from public objects in a simple to use manner. This means we can better control the public API and plugins can no...

"Nullish coalescing" is especially useful when extracting default values from passed options and can often work better than the `||` operator that is frequently used for this. Eg. here is...