Files
SocialPub/PrivaPub/Models/Statistics/InteractionEvent.cs
T
thepraandClaude Opus 5.5 0695c08ac3 A remote thread brings the replies that never reached us
The context of a remote post showed only what PrivaPub happened to hold:
replies from servers nobody here follows were never seen, and only the
ancestors were ever fetched. Now a persona opening a public remote thread
queues FetchReplies for the post and its root, at most once an hour each.

The job reads the thread's own collection first (FEP-7888 `context`, which
Mastodon 4.5+ serves with every reply at any depth; posts or, as FEP-f228
allows, the activities that made them), and otherwise the post's `replies`
(PeerTube's `comments`) and the replies' own, two levels down. At most 5
pages and 100 posts a job, signed by the instance actor, never a persona;
each post is fetched from its own origin and stored through StoreContext,
so only public and unlisted ones are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
2026-10-05 04:54:38 +02:00

34 lines
1.8 KiB
C#

using MongoDB.Entities;
namespace PrivaPub.Models.Statistics
{
public class InteractionEvent : Entity
{
public static readonly TimeSpan Retention = TimeSpan.FromDays(90);
public DateTime At { get; set; } = DateTime.UtcNow;
public string Host { get; set; }//the remote server, lowercase; "-" when unverified and unknown
public string Channel { get; set; }//recv | in | out | http | preview | crawl
public string Activity { get; set; }//Create, Follow, ...; "other" when it is no plain type name
public string Object { get; set; }//Note, Article, Person, ...
public string Purpose { get; set; }//http and crawl: actor, key, object, context, replies, webfinger, nodeinfo, ...
public string Trigger { get; set; }//http: what caused the request (inbox, deliver, describe, request, ...)
public string Outcome { get; set; }//queued, refused, accepted, dropped, ok, failed, deferred, retry, dead
public string Reason { get; set; }
public int? Status { get; set; }
public int? LatencyMs { get; set; }
public int? WaitMs { get; set; }//in: since it reached the inbox; out: since it was queued
public long? Bytes { get; set; }
public int? Attempt { get; set; }
public int? Redirects { get; set; }
public string Audience { get; set; }//public | unlisted | private | none
public string LocalKind { get; set; }//person | group | application, only on public and unlisted traffic
public string Inbox { get; set; }//shared | personal
public string Signature { get; set; }//"cavage:rsa-sha256", "none"
public string ActorHash { get; set; }//keyed with that day's salt, never reversible, never linkable across days
public List<string> Features { get; set; }
public long? AgeSeconds { get; set; }//Update and Delete: how old the object was
public bool Crawl { get; set; }
}
}