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

Fixed move worker getting locale from remote account #16576

Conversation

noellabo
Copy link
Contributor

@noellabo noellabo commented Aug 7, 2021

No description provided.

@weex
Copy link
Contributor

weex commented Aug 7, 2021

Seems simple enough to deal with missing data but I wonder why it would be missing. Is there an issue related to this?

@noellabo
Copy link
Contributor Author

noellabo commented Aug 7, 2021

There are no related issues.

This is a port from Fedibird that fixes the actual error-prone worker found in sidekiq's dead jobs.

A remote account may be specified for MoveWorker. The remote account has no data in the associated user table. If you refer to this, it will be nil. I get an error because nil doesn't have a locale method.

@ClearlyClaire
Copy link
Contributor

ClearlyClaire commented Aug 8, 2021

Hmmm, I actually don't understand how this could happen:

  • copy_account_notes! only adds notes owned by accounts which already had notes
  • add_account_note_if_needed! is only ever used with Account.local scope

EDIT: oh, unless the issue is not with remote accounts but with deleted accounts (that keep the account and account_note records around but not the user record)

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

Oh, great catch! This may well be the issue I failed to diagnose a while ago when I wrote #16415

EDIT: even better might be to just return early and do nothing if account.user is nil.

@Gargron Gargron merged commit 590e157 into mastodon:main Aug 8, 2021
@noellabo noellabo deleted the fix-move-worker-getting-locale-from-remote-account branch August 8, 2021 14:11
kadoshita pushed a commit to kadoshita/mastodon that referenced this pull request Nov 6, 2021
kadoshita pushed a commit to kadoshita/mastodon that referenced this pull request Nov 7, 2021
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this pull request Jan 28, 2022
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.

None yet

4 participants