Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make unpublishing operation asynchronous #9870

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ChrisBAshton
Copy link
Contributor

@ChrisBAshton ChrisBAshton commented Jan 30, 2025

TODO: apply the same to the 'withdraw' operation, and consider adding an integration test or two

Trello: https://trello.com/c/xlvNUI3c/3382-make-whitehalls-unpublishing-call-to-publishing-api-synchronous


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

We'll be calling this in the next commit.
Whitehall and Publishing API don't always agree on what a valid
redirect URL looks like. Consequently, unpublishing might appear
to succeed in Whitehall but be rejected downstream by Publishing
API. This caused a support ticket recently:
https://govuk.zendesk.com/agent/tickets/6016851

Switching the unpublish technique to synchronous means that any
4xx/5xx errors from Publishing API will be caught on submission,
meaning Whitehall will catch the error and display it to the user,
and roll back any Whitehall state changes. See
https://github.com/alphagov/whitehall/blob/7c5f793c56fc47e4bd6aa07839885d4387fc9b2b/app/services/edition_service.rb#L13-L17

Trello: https://trello.com/c/xlvNUI3c/3382-make-whitehalls-unpublishing-call-to-publishing-api-synchronous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant