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

Quick Reblog: Do nothing without user info #1703

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

Conversation

marcustyphoon
Copy link
Collaborator

@marcustyphoon marcustyphoon commented Jan 15, 2025

Description

Quick Reblog currently:

  • Logs a mysterious-looking error to the console if and only if the user is logged out or the user info api fetch fails and the "Remember the last selected blog in the popup" option is enabled.
  • Works, but only shows communities as reblog targets, if and only if the user info api fetch fails, the communities info api fetch doesn't fail, and the "Remember the last selected blog in the popup" option is disabled.

None of this really makes any sense as error-handling behavior. This PR makes the extension exit cleanly (though we could add a log here) if there is no user info, thus making it so that Quick Reblog:

  • Does nothing if the user is logged out.
  • Does nothing if the user info api fetch fails.
  • Never only shows communities as reblog targets.
  • Works, but doesn't show communities as reblog targets, if and only if the user info api fetch works but the communities info api fetch fails (say, if Staff changes that endpoint as part of communities development).

Resolves #1702, though not in the way proposed by the issue text.

Testing steps

  • Confirm that Quick Reblog appears and shows both user blogs and communities as reblog targets.
  • Break the user info fetch. Confirm that Quick Reblog does not appear and does not log an error.
  • Break the communities info fetch. Confirm that Quick Reblog appears and shows only user blogs reblog targets.
  • Log out. Confirm that Quick Reblog does not appear and does not log an error.

@marcustyphoon marcustyphoon added the bugfix Restores intended behavior label Jan 15, 2025
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.

User util: Intentionally fail loading when users endpoint fails
1 participant