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 Quick Reblog double reblogs after extension update/restart (alternative 4) #1601

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Aug 28, 2024

Description

Resolves #1597. See issue for background.

A fairly elegant, self-contained way to prevent this problem is to remove the previous version of the event listener. Fortunately, javascript supplies us with a way to do this: the AbortController. This is compatible with #1538, as it requires no communication between the main world script(s) and content script.

This won't apply to the instance where a version of the code without this PR merged is replaced by one with it, so this also changes the custom event names to handle that case.

Testing steps

  • Load the extension in Firefox.
  • Turn the extension on and off a large number of times.
  • Reblog a post with Quick Reblog and confirm that it is only reblogged once.

@marcustyphoon marcustyphoon added the bugfix Restores intended behavior label Aug 28, 2024
@marcustyphoon marcustyphoon merged commit 822326b into AprilSylph:master Sep 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Restores intended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Posts double-reblog after extension update/restart
2 participants