diff --git a/CHANGES.md b/CHANGES.md index 260301281..6be8a332c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,18 @@ Version 2.0.24 To be released. +### @fedify/vocab-runtime + + - Added (the + [SWICG ActivityPub Miscellaneous Terms] context, referenced by every Bridgy + Fed activity) to preloaded JSON-LD contexts. The context is served through + purl.archive.org, which suffers recurring outages; during one, JSON-LD + expansion of any activity referencing this URL fails before application + handlers can run. [[#965] by Michael Barrett] + +[SWICG ActivityPub Miscellaneous Terms]: https://swicg.github.io/miscellany/ +[#965]: https://github.com/fedify-dev/fedify/issues/965 + Version 2.0.23 -------------- diff --git a/packages/vocab-runtime/src/contexts.ts b/packages/vocab-runtime/src/contexts.ts index 82e862afd..d30a6892b 100644 --- a/packages/vocab-runtime/src/contexts.ts +++ b/packages/vocab-runtime/src/contexts.ts @@ -3,6 +3,7 @@ // cSpell: disable import joinLemmyContext from "./contexts/join-lemmy.json" with { type: "json" }; +import miscellany from "./contexts/miscellany.json" with { type: "json" }; const preloadedContexts: Record = { "https://www.w3.org/ns/activitystreams": { @@ -4363,6 +4364,18 @@ const preloadedContexts: Record = { }, }, }, + + // The SWICG "ActivityPub Miscellaneous Terms" context. Bridgy Fed (via + // granary) references this URL in the @context of every activity it sends, + // and other implementations use it as the recommended home for widely + // deployed extension terms like as:Hashtag and as:sensitive. It is served + // through purl.archive.org (Internet Archive's PURL service), which suffers + // recurring outages; while it is unreachable, every activity referencing + // this URL fails JSON-LD expansion before application handlers run. The + // document is a deliberately stable, versioned SWICG deliverable, so we + // ship a built-in copy. + // See: https://swicg.github.io/miscellany/ + "https://purl.archive.org/miscellany": miscellany, }; export default preloadedContexts; diff --git a/packages/vocab-runtime/src/contexts/miscellany.json b/packages/vocab-runtime/src/contexts/miscellany.json new file mode 100644 index 000000000..ded00596f --- /dev/null +++ b/packages/vocab-runtime/src/contexts/miscellany.json @@ -0,0 +1,19 @@ +{ + "@context": { + "as": "https://www.w3.org/ns/activitystreams#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "Hashtag": "as:Hashtag", + "manuallyApprovesFollowers": { + "@id": "as:manuallyApprovesFollowers", + "@type": "xsd:boolean" + }, + "movedTo": { + "@id": "as:movedTo", + "@type": "@id" + }, + "sensitive": { + "@id": "as:sensitive", + "@type": "xsd:boolean" + } + } +}