Fix '/kafkatorio chunks' not sending most chunks

- EventDataQueue.enqueue: `key ! in storage.store` parses as a non-null
  assertion followed by `in`, so the check was inverted: a key was only
  queued if it was already in the store. A first enqueue stored the
  event but never queued it, so it was never sent.
- The chunks command keyed the queue with `${surface}${x}${y}`, so
  different chunks collided (e.g. surface 1, (1,12) and (11,2) both
  became "1112"). Separate the parts with '_'.

Saves that ran the broken version keep orphaned queue entries; run
`/kafkatorio init_global` once to clear them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lazzexus 2026-10-12 18:16:20 +02:00
parent 47ee084eab
commit a31e392742
2 changed files with 2 additions and 2 deletions

View file

@ -60,7 +60,7 @@ commands.add_command(
}
EventDataQueue.enqueue(
`${surface.index}${chunk.x}${chunk.y}`,
`${surface.index}_${chunk.x}_${chunk.y}`,
data,
50
)

View file

@ -29,7 +29,7 @@ export class EventDataQueueManager {
enqueue(key: string, event: EventData, weight: int = 1) {
if (key ! in storage.store) {
if (storage.store[key] == undefined) {
let node = new Node(key, weight)
if (storage.head == null) {
storage.head = node