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
The problem I was having is that these two things happen exactly at the same time in this order:
the post request to the success route is sent
the response to the original request is sent (in response to 'deploy-secret-url')
Because of this the field receives a "success" state and a "progress" state at the same time, but since the progress state comes just after the success state, the success state is overwritten, and the field never reaches the success state.
The way I fixed this was by adding this code to the setState function in WebhookField.php after line 100:
if ($status == 'progress' && time() - $cache->modified($hookName) < 1000) {
return 'progress status ignored';
}
Which ignores the progress state that travels right after/with the success state given the way this code is executing.
There's probably a far more elegant solution out there (would love to learn – I didn't want to introduce queueing or async curl requests) but thought I'd post this in case it is helpful for anyone.
Thanks again!
The text was updated successfully, but these errors were encountered:
Hello! Thank you for this awesome plugin!
I have written a simple rsync deployment script, and used your plugin successfully, but had to make one (possibly stupid) modification.
Here's how the deployment works.
A route is created to trigger a deployment
It returns a JSON response
A hook runs after the route
It uses rsync to deploy the website
The problem I was having is that these two things happen exactly at the same time in this order:
Because of this the field receives a "success" state and a "progress" state at the same time, but since the progress state comes just after the success state, the success state is overwritten, and the field never reaches the success state.
The way I fixed this was by adding this code to the
setState
function inWebhookField.php
after line 100:Which ignores the progress state that travels right after/with the success state given the way this code is executing.
There's probably a far more elegant solution out there (would love to learn – I didn't want to introduce queueing or async curl requests) but thought I'd post this in case it is helpful for anyone.
Thanks again!
The text was updated successfully, but these errors were encountered: