Loading CHANGES.md +20 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,15 @@ To be released. [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch Version 0.6.1 ------------- Released on April 17, 2024. - Fixed a bug of `new Federation()` constructor that if it is once called the process will never exit. [[#39]] Version 0.6.0 ------------- Loading Loading @@ -73,6 +82,17 @@ Released on April 9, 2024. [#27]: https://github.com/dahlia/fedify/issues/27 Version 0.5.2 ------------- Released on April 17, 2024. - Fixed a bug of `new Federation()` constructor that if it is once called the process will never exit. [[#39]] [#39]: https://github.com/dahlia/fedify/issues/39 Version 0.5.1 ------------- Loading federation/middleware.ts +10 −1 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ export class Federation<TContextData> { #kv: KvStore; #kvPrefixes: FederationKvPrefixes; #queue?: MessageQueue; #queueStarted: boolean; #router: Router; #nodeInfoDispatcher?: NodeInfoDispatcher<TContextData>; #actorCallbacks?: ActorCallbacks<TContextData>; Loading Loading @@ -172,6 +173,7 @@ export class Federation<TContextData> { ...(kvPrefixes ?? {}), }; this.#queue = queue; this.#queueStarted = false; this.#router = new Router(); this.#router.add("/.well-known/webfinger", "webfinger"); this.#router.add("/.well-known/nodeinfo", "nodeInfoJrd"); Loading @@ -193,8 +195,13 @@ export class Federation<TContextData> { 15 * 60_000, 60 * 60_000, ].map((ms) => Temporal.Duration.from({ milliseconds: ms })); } queue?.listen(this.#listenQueue.bind(this)); #startQueue() { if (this.#queue != null && !this.#queueStarted) { this.#queue?.listen(this.#listenQueue.bind(this)); this.#queueStarted = true; } } async #listenQueue(message: OutboxMessage): Promise<void> { Loading Loading @@ -743,6 +750,7 @@ export class Federation<TContextData> { "The activity to send must have at least one actor property.", ); } this.#startQueue(); if (activity.id == null) { activity = activity.clone({ id: new URL(`urn:uuid:${crypto.randomUUID()}`), Loading Loading @@ -827,6 +835,7 @@ export class Federation<TContextData> { contextData, }: FederationFetchOptions<TContextData>, ): Promise<Response> { this.#startQueue(); onNotFound ??= notFound; onNotAcceptable ??= notAcceptable; onUnauthorized ??= unauthorized; Loading Loading
CHANGES.md +20 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,15 @@ To be released. [authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch Version 0.6.1 ------------- Released on April 17, 2024. - Fixed a bug of `new Federation()` constructor that if it is once called the process will never exit. [[#39]] Version 0.6.0 ------------- Loading Loading @@ -73,6 +82,17 @@ Released on April 9, 2024. [#27]: https://github.com/dahlia/fedify/issues/27 Version 0.5.2 ------------- Released on April 17, 2024. - Fixed a bug of `new Federation()` constructor that if it is once called the process will never exit. [[#39]] [#39]: https://github.com/dahlia/fedify/issues/39 Version 0.5.1 ------------- Loading
federation/middleware.ts +10 −1 Original line number Diff line number Diff line Loading @@ -130,6 +130,7 @@ export class Federation<TContextData> { #kv: KvStore; #kvPrefixes: FederationKvPrefixes; #queue?: MessageQueue; #queueStarted: boolean; #router: Router; #nodeInfoDispatcher?: NodeInfoDispatcher<TContextData>; #actorCallbacks?: ActorCallbacks<TContextData>; Loading Loading @@ -172,6 +173,7 @@ export class Federation<TContextData> { ...(kvPrefixes ?? {}), }; this.#queue = queue; this.#queueStarted = false; this.#router = new Router(); this.#router.add("/.well-known/webfinger", "webfinger"); this.#router.add("/.well-known/nodeinfo", "nodeInfoJrd"); Loading @@ -193,8 +195,13 @@ export class Federation<TContextData> { 15 * 60_000, 60 * 60_000, ].map((ms) => Temporal.Duration.from({ milliseconds: ms })); } queue?.listen(this.#listenQueue.bind(this)); #startQueue() { if (this.#queue != null && !this.#queueStarted) { this.#queue?.listen(this.#listenQueue.bind(this)); this.#queueStarted = true; } } async #listenQueue(message: OutboxMessage): Promise<void> { Loading Loading @@ -743,6 +750,7 @@ export class Federation<TContextData> { "The activity to send must have at least one actor property.", ); } this.#startQueue(); if (activity.id == null) { activity = activity.clone({ id: new URL(`urn:uuid:${crypto.randomUUID()}`), Loading Loading @@ -827,6 +835,7 @@ export class Federation<TContextData> { contextData, }: FederationFetchOptions<TContextData>, ): Promise<Response> { this.#startQueue(); onNotFound ??= notFound; onNotAcceptable ??= notAcceptable; onUnauthorized ??= unauthorized; Loading