Skip to content

Add digest re-check before removing followers in synchronization mechanism - #34273

Merged
ClearlyClaire merged 1 commit into
mainfrom
fixes/followers-synchronization-double-check
Aug 27, 2025
Merged

ClearlyClaire merged 1 commit into
mainfrom
fixes/followers-synchronization-double-check

Conversation

@ClearlyClaire

@ClearlyClaire ClearlyClaire commented Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

The follower synchronization mechanism works by computing a digest of follow the expected followers of an account on a remote server, then fetching that collection if needed.

Currently, Mastodon does not re-check the expected digest on the newly-fetched collection, as it assumes any change may just be down to the newly-fetched collection having more up-to-date values.

This PR adds re-checking of the digest before removing any follower, potentially guarding against stale caches and possible other errors, although I'm not sure when this would actually occur.

This also requires that the partial collection features no duplication, even across pages.

Benefits

  • may guard against some unlikely classes of implementation issues
  • may guard against wrongly undoing recent follows in case of stale cached collections

Drawbacks

  • increased code complexity
  • increased computation
  • requires the collection to not have duplicates across pages
  • may cause follower synchronization to be skipped if too much time occurs between receiving a hash and processing the collection

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@ClearlyClaire
ClearlyClaire force-pushed the fixes/followers-synchronization-double-check branch from c734b54 to c05ab2f Compare March 26, 2025 13:22
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has resolved merge conflicts and is ready for review.

@ClearlyClaire
ClearlyClaire marked this pull request as ready for review March 27, 2025 09:50
@mjankowski mjankowski added activitypub Protocol-related changes, federation ruby Pull requests that update Ruby code labels Mar 31, 2025
@ClearlyClaire
ClearlyClaire added this pull request to the merge queue Aug 27, 2025
Merged via the queue into main with commit c00ed9c Aug 27, 2025
@ClearlyClaire
ClearlyClaire deleted the fixes/followers-synchronization-double-check branch August 27, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub Protocol-related changes, federation ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants