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

Fixes UI infinite polling after image delete #4389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tonytw1
Copy link
Contributor

@tonytw1 tonytw1 commented Dec 29, 2024

What does this change?

After an image is deleted, Kahuna with poll endlessly looking for the deleted image to be removed from the API.
As soft deleted images do not disappear from the API, there is not way for this loop to end other than when the page is next reloaded.

Stopped the infinite polling by updating the polling function to recognise soft deleted as deleted.

Also returns the polling promise rather than void from pollDeleted.
The existing code appears to have been dropping straight instantly, without waiting for the poll to complete.

Delete from list view UI now behaves as expected; there is a noticeable pause then the image is removed from the view.

Delete from single image screen may be slightly better.
This delete triggers a search refresh to remove the deleted image and is probably catching stale Elastic eventually consistent search results most of the time. The deleted image will still be visible in the search results most of the time as per what currently happens.

I think this PR is a net improvement.

How should a reviewer test this change?

How can success be measured?

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

Recognises soft deleted as a deleted.
Returns promise to that it can be waited on.
@tonytw1 tonytw1 force-pushed the tm/image-delete-polling branch from 34fc99d to db7c10c Compare December 29, 2024 21:48
@tonytw1 tonytw1 marked this pull request as ready for review December 29, 2024 21:54
@tonytw1 tonytw1 requested review from a team as code owners December 29, 2024 21:54
@tonytw1 tonytw1 changed the title Fixes image delete infinite polling after delete Fixes UI infinite polling after image delete Dec 29, 2024
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