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

[chore/bugfix] Implement federator.FederatingCallbacks and federatingDB.Exists properly #1891

Closed
tsmethurst opened this issue Jun 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working chore a pain in the butt that needs doing
Milestone

Comments

@tsmethurst
Copy link
Contributor

tsmethurst commented Jun 14, 2023

Right now, due to an unfortunate fuck-up by YOURS TRULY years ago, our go-fed FederatingCallbacks and Exists functions aren't implemented properly:

  • Exists always returns false without doing any checks.
  • FederatingCallbacks uses default behavior for too many things (blocks, for example).

The upshot of these misimplementations is that many activities are not handled properly in the initial call to resolve the federating callbacks, and so they're only handled properly by accident when the InboxForwarding function calls Create on an activity (when Exists returns false). This causes annoyances like #1744 and other things.

Steps to resolve this:

  1. Implement Exists properly to check for (at least) statuses and accounts. [performance] reduce InboxForward->Create calls by partially implementing Exists() #3647
  2. Take that switch statement out of federatingDB.Create so that it's not doing all the heavy lifting, and move the other functionality into separate federatingDB functions. [chore] remove type switch in Create() and instead move to FederatedCallbacks() #3697
  3. Override other federating callbacks to call those new functions created in step 2.

These fixes will also pave the way to potentially implementing inbox forwarding (#1890).

@NyaaaWhatsUpDoc
Copy link
Member

Important comment from the above PR:

Unfortunately we can never return a definite answer in Exists(), since the activity JSONLD-ID doesn't necessarily match the stored object's JSONLD-ID, which is the only part that we actually store in a lot of cases. So this provides a best-effort implementation to at least reduce unnecessary calls for recently handled activities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore a pain in the butt that needs doing
Projects
None yet
Development

No branches or pull requests

2 participants