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

[bugfix] misc dereferencer fixes #2475

Conversation

NyaaaWhatsUpDoc
Copy link
Member

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc commented Dec 18, 2023

Description

  • fixes issue of new statusUpToDate() checks skipping status edits made in < 5mins after creation (as noted + tracked down by @Sentynel in matrix, thank you!). now we only perform the up-to-date check if no incoming data is provided, i.e. if we need to make an outgoing dereference request.
  • updates account dereferencing up-to-date logic to match that of statuses
  • adds a check after all webfingering + dereferencing in the account dereferencer for an empty domain [bug] Friendica accounts sometimes stored in the database with null domain #2474

the migration itself i'm thinking we write after christmas, as it will involve dropping accounts with NULL domain entries, which is VERY SCARY IN CASE WE DROP LOCAL USER ACCOUNTS. i'm thinking we perform a double check by parsing the account uris and checking the host field maybe??

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

// If this account was updated recently (last interval), we return as-is.
if next := account.FetchedAt.Add(6 * time.Hour); time.Now().Before(next) {
// Default limit we allow
// statuses to be refreshed.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should say accounts, not statuses, right?

@tsmethurst
Copy link
Contributor

Looks good, just the one comment on a comment, but feel free to squerge if you like, it's very very very minor

@tsmethurst tsmethurst merged commit 10660e5 into superseriousbusiness:main Jan 9, 2024
2 checks passed
tsmethurst pushed a commit that referenced this pull request Jan 10, 2024
* only perform status-up-to-date checks if no statusable has been provided

* copy over the same style of freshness checking from status deref -> accounts

* change some var names

* check for empty account domain
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

2 participants