aboutsummaryrefslogtreecommitdiff
path: root/apps/proxy/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-18 09:34:05 +0000
committerFuwn <[email protected]>2026-04-18 09:34:05 +0000
commit9452e64710cec25ed7b3cbade10a55b61472f5f7 (patch)
tree5ac14542ef9bbfa51fb287d28819271ad4a85d21 /apps/proxy/src
parentRevert "fix(api): drop unused redirect query param from oauth refresh" (diff)
downloaddue.moe-9452e64710cec25ed7b3cbade10a55b61472f5f7.tar.xz
due.moe-9452e64710cec25ed7b3cbade10a55b61472f5f7.zip
refactor(naming): replace banned ctx abbreviation with full names
CLAUDE.md prohibits abbreviations like ctx in identifiers. Rename the Cloudflare Worker ExecutionContext parameter to executionContext in the proxy worker (handleMangaChapterCounts, fetch, scheduled), and alias Trigger.dev's destructured { ctx } to taskContext in the notifications scheduled task. The external property name on Trigger.dev's params object is library-defined and remains ctx on the wire. Verified: proxy worker still boots under local wrangler dev and all routes (OPTIONS, POST /manga/chapter-counts, forwardProxyRequest) still respond identically.
Diffstat (limited to 'apps/proxy/src')
-rw-r--r--apps/proxy/src/index.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/proxy/src/index.js b/apps/proxy/src/index.js
index fa2503b5..e6ed8690 100644
--- a/apps/proxy/src/index.js
+++ b/apps/proxy/src/index.js
@@ -242,7 +242,7 @@ const recommendedVolumeText = (volumeChapterBoundaries, progress) => {
return recommended;
};
-const handleMangaChapterCounts = async (request, env, ctx) => {
+const handleMangaChapterCounts = async (request, env, executionContext) => {
if (!hasSupabaseConfig(env))
return jsonResponse(
request,
@@ -300,7 +300,7 @@ const handleMangaChapterCounts = async (request, env, ctx) => {
);
if (queueableRows.length)
- ctx.waitUntil(
+ executionContext.waitUntil(
Promise.all(queueBootstrap(env, queueableRows)).catch((error) => {
if (!isMangadexIdConstraintConflict(error)) throw error;
}),
@@ -375,14 +375,14 @@ const handleMangaSync = async (request, env) => {
};
export default {
- async fetch(request, env, ctx) {
+ async fetch(request, env, executionContext) {
try {
const url = new URL(request.url);
if (request.method === "OPTIONS") return handleOptions(request);
if (url.pathname === "/manga/chapter-counts" && request.method === "POST")
- return handleMangaChapterCounts(request, env, ctx);
+ return handleMangaChapterCounts(request, env, executionContext);
if (
url.pathname === "/manga/native-chapter-counts" &&
@@ -409,9 +409,9 @@ export default {
}
},
- async scheduled(_controller, env, ctx) {
+ async scheduled(_controller, env, executionContext) {
if (!hasSupabaseConfig(env)) return;
- ctx.waitUntil(syncMangadexIndex(env));
+ executionContext.waitUntil(syncMangadexIndex(env));
},
};