laravel / precognition

Anticipate the outcome of a future HTTP request.
https://laravel.com/docs/precognition
MIT License
132 stars 32 forks source link

[0.5.x] Ensures precog requests do not interfere with non-precog requests #78

Closed timacdonald closed 3 months ago

timacdonald commented 3 months ago

fixes https://github.com/laravel/precognition/issues/73

The precognition client will always cancel in-flight requests that match a new outgoing request. This is done to ensure that only the latest validation messages are returned and that we don't get out-of-order responses.

For non-Inertia libraries, we also use the client to submit forms. There are rare situations where a validation request can cancel and actual submission request.

This PR ensures that non-precognitive requests are never cancelled by the library - which is the expected behaviour.

This only impacts the non-Inertia flavoured libraries.

robdekort commented 3 months ago

Woohoo. I can confirm this PR solves #73. Amazing stuff. ❤️

timacdonald commented 3 months ago

Thanks for letting me know, @robdekort