Interop with a real GoToSocial server, and the fixes it found (phase 2, step 8)
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 10s
CI / test (push) Successful in 2m16s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 10s
CI / test (push) Successful in 2m16s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
scripts/interop/run.sh brings up Scrobbler (API, worker, UI behind a throwaway-TLS Caddy) and GoToSocial 0.22.1 on a private .test network, creates a GoToSocial user, drives its sign-in/OAuth screens for a token, and checks: lookup by handle, follow accepted, unfollow, manual approval and approve, remove, block and unblock, and decline. Found and fixed along the way: - Keys whose id is a path serving the actor (GoToSocial's <actor>/main-key) weren't resolved; now all three publishing styles are handled - An Undo of an older Follow arriving after a newer Follow removed the new follower; an Undo now only removes the Follow it names (and Undo referencing a Follow by id is understood) - Rejects embedded the Follow, which some servers (GoToSocial) match by account pair, so a late Reject could cancel a newer request; Rejects now reference the Follow by id - Unblocking didn't tell the other server; it now sends Undo(Block) - Actors publish an (empty) featured collection, which Mastodon and GoToSocial fetch GoToSocial 0.22.1 ignores Reject for already-accepted follows (a TODO in its code, fixed on its main branch); the removal check on its side is skipped until a release has it (GTS_REJECT_ENDS_FOLLOWS=1 enables). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
ec658a7751
commit
b93cfea5b3
16 files changed
+694
-17
No files matched your search
@@ -68,3 +68,22 @@ def block(user_id: int, username: str, actor: FederationRemoteActor) -> Federati
|
||||
activity = _store(user_id, lambda url: vocab.block(url, ids.actor_id(username), actor.uri))
|
||||
queue(activity, [actor.inbox])
|
||||
return activity
|
||||
|
||||
|
||||
def undo_block(
|
||||
user_id: int, username: str, actor: FederationRemoteActor
|
||||
) -> FederationActivity | None:
|
||||
"""Tell them they're unblocked: Undo our most recent Block of them (if we sent one)."""
|
||||
block_activity = db.session.scalars(
|
||||
db.select(FederationActivity)
|
||||
.filter_by(user_id=user_id, activity_type="Block")
|
||||
.filter(FederationActivity.document["object"].as_string() == actor.uri)
|
||||
.order_by(FederationActivity.created_at.desc())
|
||||
).first()
|
||||
if block_activity is None:
|
||||
return None
|
||||
activity = _store(
|
||||
user_id, lambda url: vocab.undo(url, ids.actor_id(username), block_activity.document)
|
||||
)
|
||||
queue(activity, [actor.inbox])
|
||||
return activity
|
||||
Reference in new issue
Block a user