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

fix(caa upload): prevent processing URL if it's already in progress #196

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

ROpdebee
Copy link
Owner

May close #193

In older versions, spam-clicking the provider button will lead to the same URL being processed multiple times, and possibly enqueued multiple times too, depending on the interleaving of certain async operations. To prevent this, we're now keeping a set of URLs which are currently in progress, and skip all processing of a URL entirely if it's already being processed.

@ROpdebee ROpdebee added bug Something isn't working mb_enhanced_cover_art_uploads labels Oct 30, 2021
@ROpdebee ROpdebee requested a review from kellnerd October 30, 2021 10:50
@codecov
Copy link

codecov bot commented Oct 30, 2021

Codecov Report

Merging #196 (7b0cc12) into main (7df28f0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #196   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           35        35           
  Lines          770       770           
  Branches       139       139           
=========================================
  Hits           770       770           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7df28f0...7b0cc12. Read the comment docs.

Copy link
Collaborator

@kellnerd kellnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helps against double clicking an import button (tested with the Discogs provider).
Previously this queued the images (or most of them) twice and failed to generate an edit note body (only the footer was there). With the changes it only queues the images once and successfully generates an edit note body (as it does for a single click).

@ROpdebee ROpdebee merged commit 8a65fa4 into main Oct 31, 2021
@ROpdebee ROpdebee deleted the ecau-fix-double-queue branch October 31, 2021 13:41
github-actions bot added a commit that referenced this pull request Oct 31, 2021
fix(caa upload): prevent processing URL if it's already in progress (#196)
@github-actions
Copy link

🚀 Released 1 new userscript version(s):

  • mb_enhanced_cover_art_uploads 2021.10.31.2 in 18851d9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECAU cover art gets added multiple times
2 participants