From 0d49a7b0defc16b4ff4a818b609e9708e6a79fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Jan=20Fialka?= Date: Mon, 2 Mar 2026 13:44:28 +0100 Subject: [PATCH] [Space Lua] Load scripts without priority last during reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- client/space_lua.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/space_lua.ts b/client/space_lua.ts index aa5d7c14..e68f2a5b 100644 --- a/client/space_lua.ts +++ b/client/space_lua.ts @@ -33,6 +33,7 @@ export class SpaceLuaEnvironment { orderBy: [{ expr: parseExpressionString("script.priority"), desc: true, + nulls: "last", }], } as LuaCollectionQuery, );