From 55682087a0e13e33a8be8854e522e26969861311 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Mon, 9 Mar 2026 19:48:23 +0100 Subject: [PATCH] Scope Funkwhale history sync to authenticated user --- ...atch-listening-endpoint-runtime-guards.mjs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/patch-listening-endpoint-runtime-guards.mjs b/scripts/patch-listening-endpoint-runtime-guards.mjs index 10214a63..c5d30596 100644 --- a/scripts/patch-listening-endpoint-runtime-guards.mjs +++ b/scripts/patch-listening-endpoint-runtime-guards.mjs @@ -1,6 +1,25 @@ import { access, readFile, writeFile } from "node:fs/promises"; const patchSpecs = [ + { + name: "funkwhale-client-scope-me", + marker: "prefer user-scoped history to avoid instance-wide sync volume", + oldSnippet: ` return this.fetch("/api/v2/history/listenings", { + page, + page_size: pageSize, + scope: "all", + });`, + newSnippet: ` return this.fetch("/api/v2/history/listenings", { + page, + page_size: pageSize, + // prefer user-scoped history to avoid instance-wide sync volume + scope: this.username ? "me" : "all", + });`, + candidates: [ + "node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/funkwhale-client.js", + "node_modules/@indiekit/indiekit/node_modules/@rmdes/indiekit-endpoint-funkwhale/lib/funkwhale-client.js", + ], + }, { name: "lastfm-invalid-json-guard", marker: "Invalid JSON response preview",