diff --git a/indiekit.config.mjs b/indiekit.config.mjs index 96358539..ac0d60a9 100644 --- a/indiekit.config.mjs +++ b/indiekit.config.mjs @@ -402,7 +402,7 @@ export default { activityRetentionDays: 90, storeRawActivities: false, redisUrl, - parallelWorkers: 5, + parallelWorkers: 2, actorType: "Person", logLevel: activityPubLogLevel, debugDashboard: activityPubDebugDashboard, diff --git a/scripts/patch-ap-account-lookup-cache-fallback.mjs b/scripts/patch-ap-account-lookup-cache-fallback.mjs index 66c35158..a451caf6 100644 --- a/scripts/patch-ap-account-lookup-cache-fallback.mjs +++ b/scripts/patch-ap-account-lookup-cache-fallback.mjs @@ -33,10 +33,10 @@ const OLD_SNIPPET = ` return res.status(404).json({ error: "Record not found" // ─── GET /api/v1/accounts/:id/statuses ──────────────────────────────────────`; const NEW_SNIPPET = ` // Check ap_actor_cache — populated by resolveRemoteAccount after search/lookup [patch] ap-account-lookup-cache-fallback - const cachedUrl = getActorUrlFromId(id) + const actorCacheUrl = getActorUrlFromId(id) || (collections.ap_actor_cache ? (await collections.ap_actor_cache.findOne({ _id: id }))?.actorUrl : null); - if (cachedUrl) { - const remoteAccount = await resolveRemoteAccount(cachedUrl, pluginOptions, baseUrl, collections); + if (actorCacheUrl) { + const remoteAccount = await resolveRemoteAccount(actorCacheUrl, pluginOptions, baseUrl, collections); if (remoteAccount) return res.json(remoteAccount); } @@ -73,6 +73,13 @@ for (const filePath of candidates) { continue; } + // Upstream may have already added a cachedUrl block in GET /api/v1/accounts/:id + // (e.g. fix: ap actor cache commit). If so, the functionality is already present — skip. + if (source.includes("const cachedUrl = getActorUrlFromId(id)")) { + console.log(`[postinstall] patch-ap-account-lookup-cache-fallback: already fixed upstream in ${filePath}`); + continue; + } + if (!source.includes(OLD_SNIPPET)) { console.warn( `[postinstall] patch-ap-account-lookup-cache-fallback: target snippet not found in ${filePath} — skipping`,