diff --git a/client/data/mq.datastore.ts b/client/data/mq.datastore.ts index 5a8c5eb5..4a8ff98e 100644 --- a/client/data/mq.datastore.ts +++ b/client/data/mq.datastore.ts @@ -181,13 +181,20 @@ export class DataStoreMQ { async poll(queue: string, maxItems: number): Promise { // Note: this is not happening in a transactional way, so we may get duplicate message delivery - // Retrieve a batch of messages - const messages = await this.ds.luaQuery( - [...queuedPrefix, queue], - { - limit: maxItems, - }, - ); + // Retrieve a batch of messages with an early-terminating cursor scan. + // (luaQuery would materialize the ENTIRE queue before applying the + // limit — O(queue length) per poll, quadratic over a full space reindex.) + const messages: MQMessage[] = []; + for await ( + const { value } of this.ds.query({ + prefix: [...queuedPrefix, queue], + }) + ) { + messages.push(value); + if (messages.length >= maxItems) { + break; + } + } if (messages.length === 0) { return []; } diff --git a/client/styles/modals.scss b/client/styles/modals.scss index 0a600e90..60b439a7 100644 --- a/client/styles/modals.scss +++ b/client/styles/modals.scss @@ -5,6 +5,7 @@ max-width: 90%; border-radius: 8px; overflow: hidden; + box-sizing: border-box; &::backdrop { background-color: var(--modal-backdrop-color); diff --git a/libraries/Library/Std/Editor/Lua.md b/libraries/Library/Std/Editor/Lua.md index 2ed70e7d..ac7120ea 100644 --- a/libraries/Library/Std/Editor/Lua.md +++ b/libraries/Library/Std/Editor/Lua.md @@ -68,12 +68,8 @@ local function augmentGlobal(localCode) -- Then approximate specific local tag-based object declarations in queries and add them -- matches `tags.something`, `index.tag "something"` and `index.tag("something")` patterns only for m in string.matchRegexAll(localCode, "(?:from|local)\\s+(\\w+)\\s+=\\s*(?:index\\.objects\\s*\"(\\w+)\"|index\\.objects\\s*\\(\"(\\w+)\"\\)|tags\\.(\\w+))") do - local tag - for i, t in ipairs(m) do - if i > 2 and t then - tag = t - end - end + -- m[1] = full match, m[2] = variable name, m[3..5] = tag from each alternative + local tag = m[3] or m[4] or m[5] -- Do we have a schema for this tag? local schema = config.get({"tags", tag, "schema"}) if schema then