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

Merge tag '0.5.2' into 0.6-maintenance

Fedify 0.5.2
parents 5d68fa35 9e6eab83
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -8,6 +8,9 @@ Version 0.6.1

To be released.

 -  Fixed a bug of `new Federation()` constructor that if it is once called
    the process will never exit.  [[#39]]


Version 0.6.0
-------------
@@ -53,6 +56,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
@@ -128,6 +128,7 @@ export class Federation<TContextData> {
  #kv: KvStore;
  #kvPrefixes: FederationKvPrefixes;
  #queue?: MessageQueue;
  #queueStarted: boolean;
  #router: Router;
  #nodeInfoDispatcher?: NodeInfoDispatcher<TContextData>;
  #actorCallbacks?: ActorCallbacks<TContextData>;
@@ -170,6 +171,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");
@@ -191,8 +193,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> {
@@ -715,6 +722,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()}`),
@@ -798,6 +806,7 @@ export class Federation<TContextData> {
      contextData,
    }: FederationFetchOptions<TContextData>,
  ): Promise<Response> {
    this.#startQueue();
    onNotFound ??= notFound;
    onNotAcceptable ??= notAcceptable;
    const url = new URL(request.url);