feat: #12695 Topic Synchronization via resolvable context

- Generation of a context collection digest via object ids
- Sending of said digest in ETag header
- Parsing of digests via If-None-Match header
- Update note assertion logic to handle 304 response
This commit is contained in:
Julian Lam
2024-07-16 11:37:38 -04:00
parent da25fd21ea
commit ff0c289e1d
4 changed files with 73 additions and 9 deletions

View File

@@ -43,7 +43,11 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
let chain;
const context = await activitypub.contexts.get(uid, id);
if (context) {
if (context.tid) {
unlock(id);
const { tid } = context;
return { tid, count: 0 };
} else if (context.context) {
chain = Array.from(await activitypub.contexts.getItems(uid, context));
} else {
// Fall back to inReplyTo traversal