Unverified Commit a490041c authored by Hong Minhee's avatar Hong Minhee
Browse files

Merge tag '0.6.1'

Fedify 0.6.1
parents 6d57d199 9e66924d
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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
-------------

@@ -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
-------------

+10 −1
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ export class Federation<TContextData> {
  #kv: KvStore;
  #kvPrefixes: FederationKvPrefixes;
  #queue?: MessageQueue;
  #queueStarted: boolean;
  #router: Router;
  #nodeInfoDispatcher?: NodeInfoDispatcher<TContextData>;
  #actorCallbacks?: ActorCallbacks<TContextData>;
@@ -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");
@@ -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> {
@@ -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()}`),
@@ -827,6 +835,7 @@ export class Federation<TContextData> {
      contextData,
    }: FederationFetchOptions<TContextData>,
  ): Promise<Response> {
    this.#startQueue();
    onNotFound ??= notFound;
    onNotAcceptable ??= notAcceptable;
    onUnauthorized ??= unauthorized;