M6: provenance fixes, stored features, community edits that are real edits
- A fetched ObjectRecord no longer wears the signature, key, signed headers and @context of the activity that caused the fetch, and its ReceivedAt is the fetch's own time. Its activity fields now name the trigger. Provenance answers signature null and fetchedBy "instance-actor". Migration _008 clears the old fetched records. - ObjectRecords store their ObjectFeatures extensions and context namespaces (migration _009 fills older records in batches), so statistics can count them. Provenance reads the stored lists. - ForeignAvatar.Features records what an actor document uses (ActorFeatures): featured, shared inbox, FEP-521a, FEP-8b32, identity proofs, Misskey fields, indexable, undiscoverable, locked, key size, and more. - RemoteEdits.Apply and RemoteDeletes.Remove are shared by the Update, Delete and Announce handlers. A community-wrapped Update is now an edit only when newer, refreshes polls and media otherwise, revises the ObjectRecord and re-resolves quotes. A community-wrapped Delete now tombstones the object, removes its ObjectRecord, reblogs and timeline rows, and lowers the reply count. Any deleted quoting post lowers the quoted post's quote count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELjqpznMFMNrJoJUj6K5p2
This commit is contained in:
1 parent
d37999970c
commit
90a7e38ce9
19 files changed
+505
-109
No files matched your search
@@ -64,15 +64,16 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
Id = record.ActivityId, Type = record.ActivityType, Actor = record.ActivityActorURI
|
||||
},
|
||||
Inbox = record?.Inbox,
|
||||
Signature = record?.KeyId == default ? default : new ProvenanceSignature
|
||||
FetchedBy = record?.Path == ObjectPath.Fetched ? "instance-actor" : default,
|
||||
Signature = record?.KeyId == default || record.Path == ObjectPath.Fetched ? default : new ProvenanceSignature
|
||||
{
|
||||
Scheme = record.SignatureScheme, KeyId = record.KeyId, Algorithm = record.Algorithm, Headers = record.SignedHeaders
|
||||
},
|
||||
ReceivedAt = record == default ? default : MastodonJson.Time(record.ReceivedAt),
|
||||
Published = record?.Published is { } published ? MastodonJson.Time(published) : default,
|
||||
Updated = record?.Updated is { } updated ? MastodonJson.Time(updated) : default,
|
||||
Extensions = ObjectFeatures.Detect(raw),
|
||||
ContextNamespaces = ObjectFeatures.Namespaces(raw, record?.ActivityContext),
|
||||
Extensions = record?.Extensions ?? ObjectFeatures.Detect(raw),
|
||||
ContextNamespaces = record?.ContextNamespaces ?? ObjectFeatures.Namespaces(raw, record?.ActivityContext),
|
||||
Raw = raw,
|
||||
RawBytes = record?.RawBytes ?? 0,
|
||||
RawHash = record?.RawHash,
|
||||
@@ -118,6 +119,7 @@ namespace PrivaPub.Api.Mastodon.Controllers
|
||||
public bool Refetched { get; set; }
|
||||
public ProvenanceActivity Activity { get; set; }
|
||||
public string Inbox { get; set; }
|
||||
public string FetchedBy { get; set; }
|
||||
public ProvenanceSignature Signature { get; set; }
|
||||
public string ReceivedAt { get; set; }
|
||||
public string Published { get; set; }
|
||||
|
||||
Reference in new issue
Block a user