Repository navigation
Debug tracing: alarm, duel and chat logs, daily room counters, logs script - #42
Merged
Merged
Conversation
…cript Every trace prints one JSON line to Workers Logs; the room keeps a capped per-source tail in error_log and one counters row per UTC day (flushed every 5 minutes). Owner page gains Alarms, Duels and Chat delivery filters and a counters-by-day table; scripts/logs.ts reads Workers Logs from a terminal.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes for the owner
error_log. Busy sources (alarm, duel, chat) keep 200 rows and store at most 300 a day, so traces never push real errors out.GET /api/dev/stats.node scripts/logs.ts --mode test --channel nesszersreads Workers Logs from a terminal (docs/LIVE_FIX.md).How counters reach SQLite
The room counts in memory. It saves after every alarm, on each read, after a request once 10 s have passed since the last save, and at least every 30 s while busy. A room that hibernates loses at most the last 10 s of request counts. During an alarm burst, an alarm saves like a request (at most every 10 s), so a runaway alarm loop can't double its own row writes. That last rule came from a security review of 491663d.
Evidence
bun run checkpasses, 411 of 411. The new burst test fails when the burst rule is removed (checked by reverting that one condition).event_*type after a bot duel on nesszers. Before 491663d the counters lost counts when the room went idle.tests/dev-ui.tspasses with the new counters table at 390 px.bun run test:uifails attests/ui.ts:1322(mod page rules tab, "Save new version" stays disabled after typing a max HP). It fails the same way on main, so it predates this branch.