Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8eaf637
Follow helper-returned delivery arrays
dahlia Nov 17, 2026
32b6161
Follow delivery arrays through intermediate awaits
dahlia Nov 17, 2026
da40789
Keep array helper inference inside lexical regions
dahlia Nov 17, 2026
313ee34
Follow delivery arrays through callback consumers
dahlia Nov 17, 2026
fe25d53
Preserve delivery evidence across returned arrays
dahlia Nov 17, 2026
826dbe7
Suppress helper inference across shadow bindings
dahlia Nov 17, 2026
5a63705
Report dropped async IIFEs only once
dahlia Nov 17, 2026
269f34e
Invalidate helper inference on unknown writes
dahlia Nov 17, 2026
fa38c13
Invalidate array helpers on loop target writes
dahlia Nov 17, 2026
19dd69f
Require directly held helper bindings
dahlia Nov 17, 2026
51f8024
Respect helper binding regions and var writes
dahlia Nov 17, 2026
c626972
Preserve block-initialized var helper inference
dahlia Nov 17, 2026
80326a8
Invalidate helper shapes across nested writes
dahlia Nov 17, 2026
7e1d6c0
Cover wrapped and default-invoked helper writes
dahlia Nov 18, 2026
26674a3
Test asserted patterns with the preserving parser
dahlia Nov 18, 2026
e6cdd15
Cover executable binding writes in helper inference
dahlia Nov 18, 2026
f1ca2cc
Retry interrupted compiler runtime downloads
dahlia Nov 18, 2026
84632cf
Accept terminated POSIX zombie descendants
dahlia Nov 18, 2026
b6b31ad
Follow callable defaults during invalidation
dahlia Nov 18, 2026
bb118d7
Track adopted async delivery completion
dahlia Nov 18, 2026
5896cc7
Discover default callbacks and setter mutations
dahlia Nov 18, 2026
357d40a
Keep static block helpers in their variable scope
dahlia Nov 18, 2026
c3b48e3
Invalidate alias-initialized lexical helpers
dahlia Nov 19, 2026
2701fe1
Invalidate helper shapes across loop inputs
dahlia Nov 19, 2026
243bcfd
Discover inline calls in executable binding keys
dahlia Nov 19, 2026
75acf8b
Exclude static vars from enclosing local names
dahlia Nov 19, 2026
67d650c
Follow member accessors during invalidation
dahlia Nov 19, 2026
ca441d8
Retain enclosing callees for parameter defaults
dahlia Nov 19, 2026
3e672ee
Use switch scope for case-local helper bindings
dahlia Nov 19, 2026
39f067d
Invalidate incoming parameter and catch bindings
dahlia Nov 19, 2026
08a256a
Retain enclosing mutators for body references
dahlia Nov 19, 2026
81e293d
Preserve helper evidence across property writes
dahlia Nov 20, 2026
86cf4bc
Exclude discriminants from switch helper scope
dahlia Nov 20, 2026
d8d978e
Discover constructor mutators in binding keys
dahlia Nov 20, 2026
a80f2ae
Stop property filtering at static block boundaries
dahlia Nov 22, 2026
5a0cdbc
Include root listener parameters in invalidation
dahlia Nov 22, 2026
c1e2906
Discover tagged-template mutators in binding keys
dahlia Nov 22, 2026
a35278f
Discover body aliases in every invalidation scope
dahlia Nov 22, 2026
9a132a0
Discover computed-key coercion mutators
dahlia Nov 22, 2026
e439e6d
Restrict root helper writes to local bindings
dahlia Nov 22, 2026
3f077ea
Respect static variable scopes in shadow checks
dahlia Nov 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,24 @@ To be released.
failures, and in Oxlint, where it has to be enabled by name. It is not
registered in Deno Lint, which reports every plugin rule as an error.
[[#1401], [#1443]]
- Changed `outbox-listener-delivery-not-awaited` to follow arrays of delivery
promises returned by synchronous local helpers. Awaiting or discarding
such an array now produces a warning; use `Promise.all()` to wait for its
deliveries. Mixed or unknown helper returns remain unreported.
[[#1070], [#1446]]
- Extended `raw-property-iri-invalid` to check `withRawProperty()` and
static record and tuple keys passed to `withRawProperties()`. The rule
reports invalid property IRIs and compact prefixes such as `as:content`
across Deno Lint, ESLint, and Oxlint. [[#1355], [#1420]]

[#1070]: https://github.com/fedify-dev/fedify/issues/1070
[#1272]: https://github.com/fedify-dev/fedify/issues/1272
[#1355]: https://github.com/fedify-dev/fedify/issues/1355
[#1356]: https://github.com/fedify-dev/fedify/pull/1356
[#1401]: https://github.com/fedify-dev/fedify/issues/1401
[#1420]: https://github.com/fedify-dev/fedify/pull/1420
[#1443]: https://github.com/fedify-dev/fedify/pull/1443
[#1446]: https://github.com/fedify-dev/fedify/pull/1446

### @fedify/mysql

Expand Down
10 changes: 10 additions & 0 deletions changes.d/lint/helper-delivery-arrays.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
links:
'#1070': https://github.com/fedify-dev/fedify/issues/1070
'#1446': https://github.com/fedify-dev/fedify/pull/1446
---
- Changed `outbox-listener-delivery-not-awaited` to follow arrays of delivery
promises returned by synchronous local helpers. Awaiting or discarding
such an array now produces a warning; use `Promise.all()` to wait for its
deliveries. Mixed or unknown helper returns remain unreported.
[[#1070], [#1446]]
23 changes: 16 additions & 7 deletions docs/manual/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -1017,13 +1017,22 @@ When it cannot tell where a promise goes, the rule stays quiet. In practice:
reported. A callback that is invoked immediately, or given to `map()` or
`then()`, is only as safe as the result of that call. The same holds for a
function passed by name, as in `inboxes.forEach(deliver)`.
- A local helper that delivers is judged by how it is called: `deliver();` is
reported when `deliver()` awaits or returns a delivery, and
`await deliver();` is not. An array of promises, or an object holding one,
that a helper returns is not followed to where the helper is called, since
the caller may pass it to `Promise.all()`. So `await deliverAll();` and a
bare `deliverAll();` are not reported when `deliverAll()` returns the
result of `map()`.
- For a local helper that awaits or returns a delivery, the rule reports a
bare `deliver();` call but not `await deliver();`. A synchronous helper
that consistently returns an array of delivery promises is followed to its
call sites, including through other local helpers. `await deliverAll();`,
a bare `deliverAll();`, and returning that array from the listener are
reported; use `await Promise.all(deliverAll())` to wait for the deliveries.
An intermediate `await` preserves the array:
`await Promise.all(await deliverAll())` and storing `await deliverAll()`
for later aggregation are accepted. Arrays returned by synchronous
`flatMap()` callbacks are followed through the flattened result. A named
`forEach()` callback returning a delivery array is reported because
`forEach()` discards it; a helper passed as `thisArg` is not invoked.
Mixed or unclassifiable returns stay
quiet. The rule does not follow arrays returned by `async` helpers,
recursive return chains, arrays returned through stored variables, or
objects returned by helpers.
- A promise passed to a function the rule does not know, such as
`queue.push(...)` or `setTimeout(...)`, is left alone, since the rule cannot
tell what that function does with it.
Expand Down
77 changes: 59 additions & 18 deletions packages/cli/scripts/compile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,39 @@ const failure = {
"\u001b[0m\u001b[1m\u001b[31merror\u001b[0m: Failed caching npm package '@rollup/rollup-darwin-arm64@4.60.1'\r\n 0: error reading a body from connection",
};

const binaryFailure = {
...failure,
stderr:
"error: Writing deno compile executable to temporary file '/tmp/fedify.tmp-123'\n\nCaused by:\n 0: Setting up base binary.\n 1: error reading a body from connection",
};

test("retries an interrupted base binary download with bounded attempts", async () => {
for (const succeeds of [true, false]) {
let calls = 0;
const delays: number[] = [];
const operation = compileWithDownloadRetries(
() =>
Promise.resolve(
++calls === 3 && succeeds
? { success: true, code: 0, stderr: "" }
: binaryFailure,
),
"aarch64-unknown-linux-gnu",
{
sleep: (delay) => {
delays.push(delay);
return Promise.resolve();
},
warn: () => {},
},
);
if (succeeds) await operation;
else await rejects(operation, /exit code 1/);
strictEqual(calls, 3);
deepStrictEqual(delays, [2_000, 4_000]);
}
});

test("retries an interrupted npm download and accepts a successful compile", async () => {
let calls = 0;
const delays: number[] = [];
Expand Down Expand Up @@ -65,6 +98,12 @@ test("does not retry deterministic compile failures or unrelated connection erro
"error: error reading a body from connection",
"error: Failed caching npm package 'missing-package'\npackage not found\nunrelated: error reading a body from connection",
failure.stderr + "\nerror: TS2307 Cannot find module './missing.ts'",
binaryFailure.stderr.replace(
"error reading a body from connection",
"Permission denied",
),
binaryFailure.stderr + "\nerror: TS2307 Cannot find module './missing.ts'",
binaryFailure.stderr.replace("Setting up base binary.", "Writing output."),
]) {
let calls = 0;
await rejects(
Expand All @@ -89,25 +128,27 @@ test("does not retry deterministic compile failures or unrelated connection erro
}
});

test("does not retry a signaled compiler despite earlier download diagnostics", async () => {
let calls = 0;
await rejects(
compileWithDownloadRetries(
() => {
calls++;
return Promise.resolve({ ...failure, signal: "SIGTERM" });
},
"x86_64-unknown-linux-gnu",
{
sleep: () => {
throw new Error("must not wait");
for (const downloadFailure of [failure, binaryFailure]) {
test(`does not retry a signaled compiler after ${downloadFailure === failure ? "npm" : "binary"} download diagnostics`, async () => {
let calls = 0;
await rejects(
compileWithDownloadRetries(
() => {
calls++;
return Promise.resolve({ ...downloadFailure, signal: "SIGTERM" });
},
},
),
/exit code 1/,
);
strictEqual(calls, 1);
});
"x86_64-unknown-linux-gnu",
{
sleep: () => {
throw new Error("must not wait");
},
},
),
/exit code 1/,
);
strictEqual(calls, 1);
});
}

test("propagates subprocess setup failures without retrying", async () => {
let calls = 0;
Expand Down
11 changes: 7 additions & 4 deletions packages/cli/scripts/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface RetryOptions {
warn?: (message: string) => void;
}

/** Retry interrupted npm downloads without masking deterministic compile errors. */
/** Retry interrupted compiler downloads without masking deterministic errors. */
export async function compileWithDownloadRetries(
compile: () => Promise<CompileResult>,
target: string,
Expand All @@ -36,17 +36,20 @@ export async function compileWithDownloadRetries(
const diagnostic = lastError < 0 ? "" : lines.slice(lastError).join("\n");
const interruptedDownload =
!result.signal &&
/^error: Failed caching npm package[^\r\n]*\r?\n\s*0: error reading a body from connection/.test(
(/^error: Failed caching npm package[^\r\n]*\r?\n\s*0: error reading a body from connection/.test(
diagnostic,
);
) ||
/^error: Writing deno compile executable to temporary file [^\r\n]*\r?\n\s*Caused by:\s*\r?\n\s*0: Setting up base binary\.\r?\n\s*1: error reading a body from connection/.test(
diagnostic,
));
if (!interruptedDownload || attempt === attempts) {
throw new Error(
`CLI compilation for ${target} failed with exit code ${result.code}`,
);
}
const delay = attempt * 2_000;
warn(
`npm download interrupted for ${target}; retrying compilation in ${delay}ms (${attempt + 1}/${attempts}).`,
`Compiler download interrupted for ${target}; retrying compilation in ${delay}ms (${attempt + 1}/${attempts}).`,
);
await sleep(delay);
}
Expand Down
Loading
Loading