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
47 lines
917 B
C#
47 lines
917 B
C#
using MongoDB.Entities;
|
|
|
|
namespace PrivaPub.Models.Jobs
|
|
{
|
|
public class Job : Entity
|
|
{
|
|
public JobKind Kind { get; set; }
|
|
public JobState State { get; set; }
|
|
public string Payload { get; set; }
|
|
public string Host { get; set; }
|
|
public string DedupeKey { get; set; }
|
|
public int Attempts { get; set; }
|
|
public DateTime RunAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime? LeasedUntil { get; set; }
|
|
public string LeaseOwner { get; set; }
|
|
public string LastError { get; set; }
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
public DateTime? FinishedAt { get; set; }
|
|
}
|
|
|
|
public enum JobKind
|
|
{
|
|
Deliver,
|
|
ProcessInbox,
|
|
FetchAncestors,
|
|
DescribeInstance,
|
|
PollRefresh,
|
|
PollClose,
|
|
FetchPreview,
|
|
RollupDay,
|
|
CrawlPlan,
|
|
CrawlInstance,
|
|
SendRecovery,
|
|
CountAccount,
|
|
PublishScheduled,
|
|
FetchReplies
|
|
}
|
|
|
|
public enum JobState
|
|
{
|
|
Pending,
|
|
Running,
|
|
Done,
|
|
Dead
|
|
}
|
|
}
|