Streaming: what happens, told as it happens
Mastodon's streaming API: /api/v1/streaming as a WebSocket (streams
subscribed in the URL or by message) and /api/v1/streaming/{stream} as
server-sent events, with health and the URL advertised. The user stream
tells posts reaching the persona's home (not those an exclusive list keeps
apart, which its list stream tells), notifications, edits and deletions;
public, hashtag and list streams tell what belongs in them. An in-process
hub carries ids only; each connection maps a post or a notification for its
own persona as it sends it, so nothing it may not see, or whose author it
blocked or muted, goes out. A deletion reaches only the streams that showed
the post. The token comes as access_token, header or WebSocket protocol.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
b274ce1268
commit
9268968fd4
14 files changed
+650
-30
No files matched your search
@@ -126,6 +126,7 @@ namespace PrivaPub.Federation.Inbox.Handlers
|
||||
.ExecuteFirstAsync(token);
|
||||
if (reblog == default)
|
||||
return false;
|
||||
await Domain.Timelines.Fanout.Deleting(reblog, token);
|
||||
await DB.Default.DeleteAsync<PostEntity>(reblog.ID);
|
||||
await DB.Default.DeleteAsync<TimelineEntry>(e => e.PostId == reblog.ID);
|
||||
await DB.Default.Update<PostEntity>().MatchID(reblog.ReblogOfPostId).Modify(b => b.Inc(p => p.ReblogsCount, -1)).ExecuteAsync(token);
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace PrivaPub.Federation.Inbox
|
||||
post.EditedAt = note.Updated ?? DateTime.UtcNow;
|
||||
post.UpdateDate = DateTime.UtcNow;
|
||||
await DB.Default.SaveAsync(post, token);
|
||||
await Domain.Timelines.Fanout.Edited(post, token);
|
||||
await records.Revise(note, activityId, token);
|
||||
await Requote(post, note, quotes, token);
|
||||
return true;
|
||||
@@ -97,6 +98,7 @@ namespace PrivaPub.Federation.Inbox
|
||||
public static async Task Remove(PostEntity post, string objectUri, CancellationToken token)
|
||||
{
|
||||
await Tombstone(objectUri, token);
|
||||
await Domain.Timelines.Fanout.Deleting(post, token);
|
||||
await DB.Default.DeleteAsync<PostEntity>(post.ID);
|
||||
await DB.Default.DeleteAsync<ObjectRecord>(r => r.PostId == post.ID || r.ObjectURI == objectUri);
|
||||
await DB.Default.DeleteAsync<TimelineEntry>(e => e.PostId == post.ID || e.ReblogOfPostId == post.ID);
|
||||
|
||||
Reference in new issue
Block a user