Skip to content

.pr_agent_accepted_suggestions

qodo-merge-bot edited this page Nov 18, 2026 · 232 revisions
                     PR 1625 (2026-11-18)                    
[correctness] Background failures vanish from logs
Background failures vanish from logs The generated `context.waitUntil` catches every rejection with `.catch(() => undefined)` and records no error. If post-response work rejects, the server continues without a traceback or other indication of which operation failed.

[correctness] Misspelled secret requirements go unnoticed
Misspelled secret requirements go unnoticed `requiredSecretNames` treats a `secrets` object without `required` as an empty list instead of rejecting the malformed configuration. If an operator writes `secrets: { require: ["API_KEY"] }`, deploy succeeds and the generated server neither requires `API_KEY` at startup nor exposes it through the declared worker secrets.

[correctness] Production emails go to dev inbox
Production emails go to dev inbox The generated server sets `WORKER_ENV` to `production`, then lets `CONFIG.vars` replace it with `development`. If a deployed app declares that value and uses `createMailerFromEnv`, mail capture activates instead of provider delivery, including for password resets and one-time codes.

[correctness] Deferred shard close failures vanish
Deferred shard close failures vanish `NodeShardRegistry.close()` removes a shard from `live` before its deferred disposal callback runs, so a later `dispose()` failure is neither reported nor retained for retry. This occurs when a socket close handler is pending during a non-forced close and the database refuses to close after that handler settles.

[correctness] Failed shard closes become permanent
Failed shard closes become permanent `NodeShardRegistry.close()` catches a shard's disposal error but then clears the entire `live` map, including the shard whose database did not close. If `database.close()` fails while a handler still has the connection busy, a later close attempt cannot retry it even after that handler finishes.

[correctness] One busy shard blocks database cleanup
One busy shard blocks database cleanup `registry.close({ force: true })` can throw while disposing a shard whose socket-close handler still holds an active SQLite cursor, but the generated shutdown calls all registry closes and `platform.close()` in one callback. If the first close throws after the drain deadline, shutdown logs that step's failure but skips every later registry and the platform database.

[correctness] Timed-out handlers skip database close
Timed-out handlers skip database close The generated shutdown calls `registry.close()` and `platform.close()` after a bounded drain, but shard registry closure defers database disposal until a pending socket-close handler settles. If `webSocketClose` never settles, the drain times out and the process exits without explicitly closing that shard's SQLite database.

[correctness] Renamed shards lose cron ticks
Renamed shards lose cron ticks `renderServerEntry` attaches `LUNORA_CRONS` to the binding named `SHARD`, or otherwise to the first local Durable Object binding, without identifying which binding the app uses for shards. If an app selects a differently named shard binding and lists another object first, scheduled dispatch reaches that other object's class instead of the shard and the cron function does not run.

[correctness] Malformed bindings silently vanish
Malformed bindings silently vanish `stringNames` discards Wrangler Hyperdrive and Secrets Store entries whose `binding` field is missing or not a string, while the Node deploy does not validate those entries elsewhere. If a config contains such an entry, deploy succeeds without composing or warning about the binding, and worker code that reads it receives `undefined`.

[correctness] Imported modules fail in the image
Imported modules fail in the image `bundleServer` excludes `bufferutil` and `utf-8-validate` from the bundle, but the generated package manifest installs only `better-sqlite3`. If the worker imports either excluded module directly, deployment can succeed while the container fails to start because the module is absent.

[correctness] Required secrets vanish on deploy
Required secrets vanish on deploy `readNodeDeployProject` silently turns a malformed `secrets.required` value into an empty list instead of rejecting the configuration. With `"secrets": { "required": "API_KEY" }`, the Node deploy bypasses Wrangler validation, builds a container, and starts the worker without requiring or binding `API_KEY`.

[correctness] Shutdown skips platform and registry close if server close fails
Shutdown skips platform and registry close if server close fails The generated `stop()` awaits `server.close()` and then runs `Promise.all(pending)`, `platform?.drain()`, the registry `close()` loop and `platform?.close()` in straight-line code with no `finally`. If `server.close()` rejects, the SQLite-backed platform and shard registries are never drained or closed, and the SIGINT/SIGTERM handler reaches `process.exit(1)` with those handles still open. The rule requires secondary cleanup to run in `finally` even when server close throws, and this path runs on every container shutdown.

[correctness] Shutdown can close an active shard
Shutdown can close an active shard `createNodePlatform().drain()` runs the host and registry drains concurrently, then returns the registry result without checking for shard work that began after that drain completed. If host background work keeps the platform drain open while a scheduled delivery starts a new shard request, shutdown can report a successful drain and proceed to close its database while that request is active.

[correctness] Stalled shard work exits without warning
Stalled shard work exits without warning `startDrainDeadline` unrefs the timer that bounds shard draining, so that timer cannot keep the container alive while the drain awaits an unsettled promise. If a shard handler remains pending after the HTTP connections close and no other event-loop handle remains, Node exits before the deadline fires, without logging the unfinished work or explicitly closing the databases.

[correctness] Virtual-entry apps cannot build an image
Virtual-entry apps cannot build an image `readNodeDeployProject` treats `wrangler.main` as a filesystem path even when it names `virtual:lunora/worker`. Class-A templates use that virtual entry and have no corresponding file, so esbuild cannot resolve the generated import.

[correctness] Missing secrets reach running workers
Missing secrets reach running workers The generated server uses `workerSecrets` only to document `secrets.required`, without checking those variables before it starts listening. If a required variable is unset, the worker receives `undefined` through `env` and the container still starts, leaving the failure to whichever request first needs the secret.

[correctness] External object bindings fail silently
External object bindings fail silently `readNodeDeployProject` skips Durable Object bindings with `script_name` without adding them to the unbound-binding warning. A config with a local `SHARD` and an external binding therefore builds successfully, but the generated worker environment has no namespace for the external binding when app code accesses it.

[correctness] Shutdown can lose shard background work
Shutdown can lose shard background work `stop()` drains top-level worker work and the platform root but does not await Durable Object shard-host `waitUntil()` work before closing registries. When a signal arrives during a shard request or alarm with pending work, that work can still be using SQLite as its database is closed or can be terminated by `process.exit(0)`.

[correctness] Framework projects cannot build containers
Framework projects cannot build containers `readNodeDeployProject` resolves Wrangler's `main` as a filesystem path, even when a supported framework template sets it to the virtual specifier `virtual:lunora/worker`. For those projects, Node deployment skips the existing framework build and gives esbuild a nonexistent entry, so it cannot produce the container.

[correctness] Migration flags silently do nothing
Migration flags silently do nothing `CONTAINER_REFUSED_FLAGS` includes `--migrate` but omits its URL, token and confirmation flags. A Node deploy given any of those flags without `--migrate` runs codegen, writes the context and returns success without using them.

[correctness] Scheduled jobs disappear without warning
Scheduled jobs disappear without warning `runNodeContainerDeploy` compares Wrangler triggers against `codegen.result.cronTriggers`, which includes `createWorker` schedules absent from the generated `LUNORA_CRONS` map. When a trigger is used only by `createWorker({ backupCron })` or `createWorker({ crons })`, the comparison suppresses the warning even though the container never invokes the worker’s `scheduled()` handler.

[correctness] A very large shutdown timeout skips the drain
A very large shutdown timeout skips the drain The startup check for `LUNORA_SHUTDOWN_TIMEOUT_MS` accepts any safe integer and passes it unchanged to shutdown timers, even though Node treats delays above 2147483647 ms as 1 ms. When an operator sets a value such as `3000000000`, the generated `drainSet` and platform-node deadline timers fire almost immediately, cutting off `waitUntil`, alarm, and shard work before the databases close and the process exits with code 1.

[correctness] Bad drain options stop scheduled jobs
Bad drain options stop scheduled jobs `createNodePlatform().drain()` suspends the scheduler and alarms before `drainTogether()` validates `timeoutMs`. If a caller passes an invalid timeout, the drain throws but the one-way suspension remains, so jobs and alarms stop firing on that platform instance.

[correctness] Cron ticks and alarms can start after the drain finishes
Cron ticks and alarms can start after the drain finishes The new `platform.drain()` calls `drainTogether([host, registry])` but never suspends scheduler job/cron timers or shard alarm timers, and `idle()`/`pending()` count a timer only after its callback has started tracking a delivery. In the generated server's shutdown, a timer that fires after the `draining shards` step returns, while the sequential `registry.close({ force: true })` and `platform.close({ force: true })` steps are still running, starts a cron run or alarm that the forced close then cuts off. Nothing logs that run as pending work.

[correctness] Requested framework builds are skipped
Requested framework builds are skipped `runDeployCommand` sends Node deploys directly to `runNodeContainerDeploy`, which runs codegen and bundles the worker without reading `frameworkBuild`. A standalone worker project that passes `--framework-build` can therefore receive a successful deploy result without the requested client build running.

[correctness] A declared variable disappears from the worker
A declared variable disappears from the worker `declaredVariables` accepts `__proto__`, but `renderServerEntry` embeds `vars` in a JavaScript object literal where that key sets the object's prototype rather than creating an enumerable property. When a Wrangler config declares `vars.__proto__`, the generated server omits it from `Object.keys(CONFIG.vars)` and the worker never receives the declared value.

[correctness] A var sharing a binding's name is silently replaced
A var sharing a binding's name is silently replaced `readNodeDeployProject` refuses only an overlap between `secrets.required` and `secrets_store_secrets`. It never compares `vars`, `secrets.required` or the Hyperdrive binding against the Durable Object binding names. The generated entry fills `env` with vars and secrets first, then Hyperdrive, then writes `env[binding.name] = createNodeShardNamespace(...)` for each Durable Object. A config such as `vars: { SHARD: "x" }` next to a `SHARD` Durable Object, or a Hyperdrive binding with a DO's name, therefore deploys without error, and the worker silently gets the namespace in place of the declared value.

[correctness] One unreadable shard file stops the whole server from starting
One unreadable shard file stops the whole server from starting `rearmPersistedAlarms` treats any error from `hasPersistedAlarm` as "has an alarm" and then calls `shardFor(key)` for that key with no per-shard try/catch. The generated `server.mjs` calls it at top level before listening, so a single corrupt, truncated or permission-denied shard file now crashes startup for every shard. Before this change only requests to that one shard failed.

[correctness] Backups sharing a cron schedule are skipped without warning
Backups sharing a cron schedule are skipped without warning `runNodeContainerDeploy` decides which wrangler `triggers.crons` go unserved by checking each trigger against the keys of the generated `LUNORA_CRONS` map (`artifact.deliveredCrons`). A trigger used by both a `cronJobs()` job and `createWorker({ backupCron })` or a `createWorker({ crons })` handler therefore counts as delivered, so the deploy prints no warning, yet the container never calls `scheduled()` and the nightly NDJSON backup or entry handler on that expression never runs.

[correctness] New shard work is omitted from shutdown logs
New shard work is omitted from shutdown logs `drainTogether` returns the pending lists captured by individual drains as soon as one times out, without rechecking parts whose drains already finished. If work starts on one of those parts while another is still draining, shutdown can force-close it without naming that work in the timeout result.

[correctness] An old waitUntil failure makes a clean shutdown exit 1
An old waitUntil failure makes a clean shutdown exit 1 The generated server's `waitUntil` pushes every rejection into the module-level `backgroundFailures` array, and only `drainSet` clears it with `splice(0)` during shutdown. Over the life of the process the array grows by one entry per failed background task, and on SIGTERM even a failure from days earlier marks the drain failed, so a graceful stop reports exit code 1.

[correctness] Worker defines can prevent container startup
Worker defines can prevent container startup `bundleServer` applies Wrangler `define` and `alias` settings to the generated Node server as well as the worker they are intended to bundle. If a project defines `process.env` as a build-time object, esbuild also replaces the server's required-environment checks, so the container can refuse to start even when its required variables are set.

[correctness] Repeated secret names block Node deploy
Repeated secret names block Node deploy `refuseEnvCollisions` treats two occurrences within `secrets.required` as competing owners because it checks the number of entries rather than distinct sources. A project listing the same required secret twice passes the existing config validation and is deduplicated for local worker setup, but the Node deploy now stops before codegen.

[correctness] Container builds ignore Worker constants
Container builds ignore Worker constants `readNodeDeployProject` treats Wrangler’s `define` and `alias` settings as handled configuration, but `bundleServer` passes neither setting to esbuild. An app that relies on a defined build-time constant can deploy successfully and then fail with a `ReferenceError` at runtime; an aliased import can resolve to a different module or fail to bundle.

[correctness] Scheduled backups and entry crons never run in the container
Scheduled backups and entry crons never run in the container `COMPOSED_OR_CONFIG_KEYS` lists `triggers` as a key the Node server composes, but `renderServerEntry` only arms `LUNORA_CRONS` on `createNodePlatform` and never calls the worker's `scheduled()` export. Any `createWorker({ backupCron })` NDJSON backup or `createWorker({ crons })` handler runs only from `scheduled()`, so in the container it never fires, and the deploy prints no unbound-binding warning about it.

[correctness] Shutdown stalls when an alarm retry is waiting on a transaction
Shutdown stalls when an alarm retry is waiting on a transaction `retryFailedDelivery` puts its retry step and `onSettled` callback in the shared `alarmTimeout` slot through `afterTransaction`, but `clearAlarmTimeout` can cancel that timer without settling the tracked delivery. When an alarm handler fails during another task’s transaction and an alarm commit, set, delete, or rollback resync replaces the timer before it fires, the delivery remains in `deliveries`, keeping `pendingAlarms()` nonzero and `idle()` false while shutdown `drain()` times out and exits with code 1.

[correctness] Fatal shutdown errors exit successfully
Fatal shutdown errors exit successfully `shutdown(1)` returns when `stopping` is already true without updating the first shutdown call’s local `failed` flag, which determines the exit code. If an unhandled rejection or uncaught exception occurs after SIGTERM starts an otherwise successful shutdown, the error is logged but the running `shutdown(0)` can still call `process.exit(0)`.

[correctness] Failed requests can expose URL secrets
Failed requests can expose URL secrets `createNodeHttpServer` logs the raw `incoming.url` when its HTTP fetch handler rejects, including the client-supplied query string. A hand-written worker that rejects while handling a callback code or signed URL causes that credential to be written to server logs alongside the error.

[correctness] Shutdown can hang while traffic keeps arriving
Shutdown can hang while traffic keeps arriving `NodeHttpServer.drain()` waits until the tracked `responses` set is empty, but requests arriving during shutdown—including those answered with a 503—are added to that set while the listener remains open. Under steady traffic or repeated health checks, the set may never be empty, preventing shutdown from reaching listener closure, `waitUntil` and shard drains, or database cleanup before an orchestrator terminates the process.

[correctness] Shard drain can finish with background work still running
Shard drain can finish with background work still running `NodeShardRegistry.drain` drains a snapshot of live shards but decides whether to repeat using only `inFlight` and socket-closing state, so it misses background work added to an already-drained shard or a shard created during the pass. When a tracked fetch or alarm starts that work and settles before the pass ends, the loop can exit, and the generated server proceeds to close the registries while the work is still writing to a shard database.

[correctness] Some secret names crash the container
Some secret names crash the container `readNodeDeployProject` accepts every `secrets_store_secrets` binding name and the generated entry passes those names to `createNodeSecretBindings` at startup. If a binding starts with `LUNORA_`, that helper throws, so deploy can report success and produce an image that cannot start.

[correctness] Stale files can reach a Docker builder
Stale files can reach a Docker builder `buildNodeContainer` reuses the output directory and overwrites only its five generated files, while `.dockerignore` excludes only a few filename patterns. If that directory already contains an unignored sensitive file, invoking `--image` can include it in the Docker build context sent to a builder even though the generated Dockerfile does not copy it into the image.

[correctness] Object-valued wrangler vars reach the app as JSON strings
Object-valued wrangler vars reach the app as JSON strings `readNodeDeployProject` runs `JSON.stringify` on every non-string `vars` value, and the generated entry spreads those strings into `env`. On Cloudflare, wrangler passes JSON-object vars to the worker as parsed objects, so code that reads `env.FEATURES.enabled` works there but gets `undefined` (or breaks on a string) in the Node container.

[correctness] Deployment attribution disappears silently
Deployment attribution disappears silently `UNBOUND_BINDING_KEYS` omits Wrangler's `version_metadata`, so the generated server neither binds it nor warns that it is absent. Templates declaring `CF_VERSION_METADATA` consequently run without the object their version reader expects, leaving deployment IDs unavailable to request logging.

[correctness] --prebuilt ships a Node image built from stale code
--prebuilt ships a Node image built from stale code `execute` maps `--prebuilt` to `skipCodegen: true`, and `runNodeContainerDeploy` honours that by skipping codegen. It then bundles whatever is in `_generated/*`. The only check is that `crons.ts` exists, so output from an earlier Cloudflare-target codegen or `lunora dev` run passes and ends up in `server.mjs`.

[correctness] Image requests can publish a Worker
Image requests can publish a Worker `--image` is accepted for every deploy target, but only `runNodeContainerDeploy` reads `options.image`. If a caller supplies it with a Cloudflare target, the normal deploy path ignores the image request and can publish the Worker instead.

[correctness] Some app errors prompt the wrong upgrade
Some app errors prompt the wrong upgrade `missingExportRefusal` treats any diagnostic filename containing `platform-node` as an outdated platform package instead of checking whether it refers to the package. When a worker entry such as `src/platform-node-worker.ts` or an entry under `src/platform-node/` lacks a required export, deploy advises upgrading the platform rather than identifying the missing worker export.

[correctness] Container logs show an unusable URL
Container logs show an unusable URL The generated entry logs `server.origin`, which is the HTTP server's bind address rather than its configured public origin. With the image's default `HOST=0.0.0.0`, startup therefore advertises `http://0.0.0.0:8787` even when `LUNORA_ORIGIN_URL` names the URL users can open.

[correctness] Misspelled secret requirements go unnoticed
Misspelled secret requirements go unnoticed `requiredSecretNames` treats a `secrets` object without `required` as an empty list instead of rejecting the malformed configuration. If an operator writes `secrets: { require: ["API_KEY"] }`, deploy succeeds and the generated server neither requires `API_KEY` at startup nor exposes it through the declared worker secrets.

[correctness] Background failures vanish from logs
Background failures vanish from logs The generated `context.waitUntil` catches every rejection with `.catch(() => undefined)` and records no error. If post-response work rejects, the server continues without a traceback or other indication of which operation failed.

[correctness] Deferred shard close failures vanish
Deferred shard close failures vanish `NodeShardRegistry.close()` removes a shard from `live` before its deferred disposal callback runs, so a later `dispose()` failure is neither reported nor retained for retry. This occurs when a socket close handler is pending during a non-forced close and the database refuses to close after that handler settles.

[correctness] Failed shard closes become permanent
Failed shard closes become permanent `NodeShardRegistry.close()` catches a shard's disposal error but then clears the entire `live` map, including the shard whose database did not close. If `database.close()` fails while a handler still has the connection busy, a later close attempt cannot retry it even after that handler finishes.

[correctness] One busy shard blocks database cleanup
One busy shard blocks database cleanup `registry.close({ force: true })` can throw while disposing a shard whose socket-close handler still holds an active SQLite cursor, but the generated shutdown calls all registry closes and `platform.close()` in one callback. If the first close throws after the drain deadline, shutdown logs that step's failure but skips every later registry and the platform database.

[correctness] Shutdown can close an active shard
Shutdown can close an active shard `createNodePlatform().drain()` runs the host and registry drains concurrently, then returns the registry result without checking for shard work that began after that drain completed. If host background work keeps the platform drain open while a scheduled delivery starts a new shard request, shutdown can report a successful drain and proceed to close its database while that request is active.

[correctness] Stalled shard work exits without warning
Stalled shard work exits without warning `startDrainDeadline` unrefs the timer that bounds shard draining, so that timer cannot keep the container alive while the drain awaits an unsettled promise. If a shard handler remains pending after the HTTP connections close and no other event-loop handle remains, Node exits before the deadline fires, without logging the unfinished work or explicitly closing the databases.

[correctness] Framework projects cannot build containers
Framework projects cannot build containers `readNodeDeployProject` resolves Wrangler's `main` as a filesystem path, even when a supported framework template sets it to the virtual specifier `virtual:lunora/worker`. For those projects, Node deployment skips the existing framework build and gives esbuild a nonexistent entry, so it cannot produce the container.

[correctness] Shutdown can lose shard background work
Shutdown can lose shard background work `stop()` drains top-level worker work and the platform root but does not await Durable Object shard-host `waitUntil()` work before closing registries. When a signal arrives during a shard request or alarm with pending work, that work can still be using SQLite as its database is closed or can be terminated by `process.exit(0)`.

[correctness] Scheduled jobs disappear without warning
Scheduled jobs disappear without warning `runNodeContainerDeploy` compares Wrangler triggers against `codegen.result.cronTriggers`, which includes `createWorker` schedules absent from the generated `LUNORA_CRONS` map. When a trigger is used only by `createWorker({ backupCron })` or `createWorker({ crons })`, the comparison suppresses the warning even though the container never invokes the worker’s `scheduled()` handler.

[correctness] A very large shutdown timeout skips the drain
A very large shutdown timeout skips the drain The startup check for `LUNORA_SHUTDOWN_TIMEOUT_MS` accepts any safe integer and passes it unchanged to shutdown timers, even though Node treats delays above 2147483647 ms as 1 ms. When an operator sets a value such as `3000000000`, the generated `drainSet` and platform-node deadline timers fire almost immediately, cutting off `waitUntil`, alarm, and shard work before the databases close and the process exits with code 1.

[correctness] Migration flags silently do nothing
Migration flags silently do nothing `CONTAINER_REFUSED_FLAGS` includes `--migrate` but omits its URL, token and confirmation flags. A Node deploy given any of those flags without `--migrate` runs codegen, writes the context and returns success without using them.

[correctness] Shutdown reports a clean drain after cutting off work
Shutdown reports a clean drain after cutting off work `drainTogether` retains the final sweep’s `failed` entries but discards its `timedOut` and `pending` results, always returning `timedOut: false` and an empty pending list. If a cron tick or alarm starts after the initial idle check and remains active through the shared deadline, the platform drain can time out during that sweep, yet the generated server logs no pending work, force-closes the shard database, and exits 0.

[correctness] Custom JSX settings break container builds
Custom JSX settings break container builds `appScopedPlugin` transforms application files with `esbuild.transform()` without passing the project's TypeScript or JSX settings, then returns the output as plain JavaScript. When a worker project has Wrangler `define` settings and uses JSX configured through `tsconfig.json`, the container bundle can lower that JSX with different semantics from the project's configured build.

[correctness] New shard work is omitted from shutdown logs
New shard work is omitted from shutdown logs `drainTogether` returns the pending lists captured by individual drains as soon as one times out, without rechecking parts whose drains already finished. If work starts on one of those parts while another is still draining, shutdown can force-close it without naming that work in the timeout result.

[correctness] An old waitUntil failure makes a clean shutdown exit 1
An old waitUntil failure makes a clean shutdown exit 1 The generated server's `waitUntil` pushes every rejection into the module-level `backgroundFailures` array, and only `drainSet` clears it with `splice(0)` during shutdown. Over the life of the process the array grows by one entry per failed background task, and on SIGTERM even a failure from days earlier marks the drain failed, so a graceful stop reports exit code 1.

[correctness] One unreadable shard file stops the whole server from starting
One unreadable shard file stops the whole server from starting `rearmPersistedAlarms` treats any error from `hasPersistedAlarm` as "has an alarm" and then calls `shardFor(key)` for that key with no per-shard try/catch. The generated `server.mjs` calls it at top level before listening, so a single corrupt, truncated or permission-denied shard file now crashes startup for every shard. Before this change only requests to that one shard failed.

[correctness] Worker defines can prevent container startup
Worker defines can prevent container startup `bundleServer` applies Wrangler `define` and `alias` settings to the generated Node server as well as the worker they are intended to bundle. If a project defines `process.env` as a build-time object, esbuild also replaces the server's required-environment checks, so the container can refuse to start even when its required variables are set.

[correctness] Repeated secret names block Node deploy
Repeated secret names block Node deploy `refuseEnvCollisions` treats two occurrences within `secrets.required` as competing owners because it checks the number of entries rather than distinct sources. A project listing the same required secret twice passes the existing config validation and is deduplicated for local worker setup, but the Node deploy now stops before codegen.

[correctness] Shutdown stalls when an alarm retry is waiting on a transaction
Shutdown stalls when an alarm retry is waiting on a transaction `retryFailedDelivery` puts its retry step and `onSettled` callback in the shared `alarmTimeout` slot through `afterTransaction`, but `clearAlarmTimeout` can cancel that timer without settling the tracked delivery. When an alarm handler fails during another task’s transaction and an alarm commit, set, delete, or rollback resync replaces the timer before it fires, the delivery remains in `deliveries`, keeping `pendingAlarms()` nonzero and `idle()` false while shutdown `drain()` times out and exits with code 1.

[correctness] Fatal shutdown errors exit successfully
Fatal shutdown errors exit successfully `shutdown(1)` returns when `stopping` is already true without updating the first shutdown call’s local `failed` flag, which determines the exit code. If an unhandled rejection or uncaught exception occurs after SIGTERM starts an otherwise successful shutdown, the error is logged but the running `shutdown(0)` can still call `process.exit(0)`.

[correctness] Failed requests can expose URL secrets
Failed requests can expose URL secrets `createNodeHttpServer` logs the raw `incoming.url` when its HTTP fetch handler rejects, including the client-supplied query string. A hand-written worker that rejects while handling a callback code or signed URL causes that credential to be written to server logs alongside the error.

[correctness] Shutdown can hang while traffic keeps arriving
Shutdown can hang while traffic keeps arriving `NodeHttpServer.drain()` waits until the tracked `responses` set is empty, but requests arriving during shutdown—including those answered with a 503—are added to that set while the listener remains open. Under steady traffic or repeated health checks, the set may never be empty, preventing shutdown from reaching listener closure, `waitUntil` and shard drains, or database cleanup before an orchestrator terminates the process.

[correctness] Shard drain can finish with background work still running
Shard drain can finish with background work still running `NodeShardRegistry.drain` drains a snapshot of live shards but decides whether to repeat using only `inFlight` and socket-closing state, so it misses background work added to an already-drained shard or a shard created during the pass. When a tracked fetch or alarm starts that work and settles before the pass ends, the loop can exit, and the generated server proceeds to close the registries while the work is still writing to a shard database.

[correctness] Some secret names crash the container
Some secret names crash the container `readNodeDeployProject` accepts every `secrets_store_secrets` binding name and the generated entry passes those names to `createNodeSecretBindings` at startup. If a binding starts with `LUNORA_`, that helper throws, so deploy can report success and produce an image that cannot start.

[correctness] Stale files can reach a Docker builder
Stale files can reach a Docker builder `buildNodeContainer` reuses the output directory and overwrites only its five generated files, while `.dockerignore` excludes only a few filename patterns. If that directory already contains an unignored sensitive file, invoking `--image` can include it in the Docker build context sent to a builder even though the generated Dockerfile does not copy it into the image.

[correctness] Object-valued wrangler vars reach the app as JSON strings
Object-valued wrangler vars reach the app as JSON strings `readNodeDeployProject` runs `JSON.stringify` on every non-string `vars` value, and the generated entry spreads those strings into `env`. On Cloudflare, wrangler passes JSON-object vars to the worker as parsed objects, so code that reads `env.FEATURES.enabled` works there but gets `undefined` (or breaks on a string) in the Node container.

[correctness] Deployment attribution disappears silently
Deployment attribution disappears silently `UNBOUND_BINDING_KEYS` omits Wrangler's `version_metadata`, so the generated server neither binds it nor warns that it is absent. Templates declaring `CF_VERSION_METADATA` consequently run without the object their version reader expects, leaving deployment IDs unavailable to request logging.

[correctness] --prebuilt ships a Node image built from stale code
--prebuilt ships a Node image built from stale code `execute` maps `--prebuilt` to `skipCodegen: true`, and `runNodeContainerDeploy` honours that by skipping codegen. It then bundles whatever is in `_generated/*`. The only check is that `crons.ts` exists, so output from an earlier Cloudflare-target codegen or `lunora dev` run passes and ends up in `server.mjs`.

[correctness] Image requests can publish a Worker
Image requests can publish a Worker `--image` is accepted for every deploy target, but only `runNodeContainerDeploy` reads `options.image`. If a caller supplies it with a Cloudflare target, the normal deploy path ignores the image request and can publish the Worker instead.

[correctness] Some app errors prompt the wrong upgrade
Some app errors prompt the wrong upgrade `missingExportRefusal` treats any diagnostic filename containing `platform-node` as an outdated platform package instead of checking whether it refers to the package. When a worker entry such as `src/platform-node-worker.ts` or an entry under `src/platform-node/` lacks a required export, deploy advises upgrading the platform rather than identifying the missing worker export.

[correctness] Container logs show an unusable URL
Container logs show an unusable URL The generated entry logs `server.origin`, which is the HTTP server's bind address rather than its configured public origin. With the image's default `HOST=0.0.0.0`, startup therefore advertises `http://0.0.0.0:8787` even when `LUNORA_ORIGIN_URL` names the URL users can open.


Clone this wiki locally