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
{{ message }}
Repository navigation
Show clear feedback when snippet activation fails #516
When activation fails because a snippet contains invalid code, the activation switch on the snippets table may appear enabled temporarily without explaining that the snippet remains inactive. Opening the snippet afterward shows that it was not activated.
This exposes a partial-success case that the current issue and PR #488 need to handle. The activation or deactivation request can return HTTP 500 after the database state has already changed. Because the snippets list refresh runs only after a successful response, the controlled switch keeps showing its previous state until the page is reloaded.
The failure message must not state that nothing changed without reconciling the saved state. On request failure, the UI should refetch the snippet and display the actual state, while still reporting the server error. The endpoint should also avoid returning a failure after committing the state where possible.
Activity
code-snippets-bot commentedon Sep 3, 2026
Additional report: https://wordpress.org/support/topic/toggles-dont-change-state-after-update-to-3-10-2/
This exposes a partial-success case that the current issue and PR #488 need to handle. The activation or deactivation request can return HTTP 500 after the database state has already changed. Because the snippets list refresh runs only after a successful response, the controlled switch keeps showing its previous state until the page is reloaded.
The failure message must not state that nothing changed without reconciling the saved state. On request failure, the UI should refetch the snippet and display the actual state, while still reporting the server error. The endpoint should also avoid returning a failure after committing the state where possible.
mszyplinski commentedon Oct 12, 2026
Are you going to fix it?