[Space Lua] Load scripts without priority last during reload

The new null-aware ordering in `orderByCompare` changed the default
placement of undefined values for descending sorts to `nulls first` (SQL
standard). This caused Space Lua scripts without a `-- priority:`
comment to load before the `Std` library scripts and breaking the boot
sequence for user scripts ran before `schema`, `config`, `widget` and
other core definitions were available.

Add explicit `nulls: "last"` to the reload query so scripts without
priority always load last, matching the documented behavior.

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
This commit is contained in:
Matouš Jan Fialka
2026-03-02 13:44:28 +01:00
parent ff6854f6ee
commit 0d49a7b0de
+1
View File
@@ -33,6 +33,7 @@ export class SpaceLuaEnvironment {
orderBy: [{
expr: parseExpressionString("script.priority"),
desc: true,
nulls: "last",
}],
} as LuaCollectionQuery,
);