An id reused for another activity is not a copy
Friendica's activity ids are uniqid(): a short prefix and the microsecond. Two of its processes answering two follows at once gave both Accepts one id, and PrivaPub, queueing each inbox activity once per id, dropped the second as a copy: that follow stayed pending on our side while Friendica counted the persona as a follower (seen in the town's Friendica pair). An id that comes back carrying another type, actor or object is now queued apart; a true copy is still dropped. 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
7eb7c017a5
commit
e485f7bd47
5 files changed
+64
-4
No files matched your search
@@ -27,6 +27,7 @@ namespace PrivaPub.Infrastructure.Jobs
|
||||
public interface IJobQueue
|
||||
{
|
||||
Task<bool> Enqueue(JobKind kind, string payload, string host, string dedupeKey, CancellationToken token);
|
||||
Task<string> Payload(string dedupeKey, CancellationToken token);
|
||||
Task<int> EnqueueMany(IEnumerable<Job> jobs, CancellationToken token);
|
||||
Task<Job> Lease(JobKind kind, IReadOnlyCollection<string> busyHosts, CancellationToken token);
|
||||
Task Finish(Job job, JobOutcome outcome, int maxAttempts, CancellationToken token);
|
||||
@@ -51,6 +52,10 @@ namespace PrivaPub.Infrastructure.Jobs
|
||||
public async Task<bool> Enqueue(JobKind kind, string payload, string host, string dedupeKey, CancellationToken token) =>
|
||||
await EnqueueMany(new[] { new Job { Kind = kind, Payload = payload, Host = host, DedupeKey = dedupeKey } }, token) == 1;
|
||||
|
||||
// what the job a dedupe key names carries, or null when there is none
|
||||
public async Task<string> Payload(string dedupeKey, CancellationToken token) =>
|
||||
(await DB.Default.Find<Job>().Match(j => j.DedupeKey == dedupeKey).ExecuteFirstAsync(token))?.Payload;
|
||||
|
||||
public async Task<int> EnqueueMany(IEnumerable<Job> jobs, CancellationToken token)
|
||||
{
|
||||
var inserted = 0;
|
||||
|
||||
Reference in new issue
Block a user