[High] [Bug] Activity log flooded with duplicate PAUSED conversion messages every tick #337
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: Activity log flooded with duplicate "PAUSED" conversion messages
Steps to reproduce
mana-loop-ui-storage→logsExpected
Activity log shows meaningful events, possibly a few "conversion paused" warnings at most.
Actual
Activity log is flooded with 50+ identical messages like:
These repeat every tick (200ms), quickly filling the log and causing performance degradation.
Root cause
In
gameStore.tstick pipeline, the conversion pause logging runs every tick for every paused conversion without any deduplication or throttling. With many elements unlocked but insufficient regen, this generates 3+ log messages per tick.Store
useGameStore→gameStore.ts→ tick pipeline (conversion pause logging loop)Starting investigation. Root cause identified in issue: conversion pause logging in the tick pipeline runs every 200ms without deduplication. Will locate the exact code in gameStore.ts / tick-pipeline.ts.
Fix Applied
Root cause: In
stores/gameStore.ts, the conversion pause logging loop at line 181-184 ran every tick (200ms) for every paused conversion without any deduplication. With many elements unlocked but insufficient raw regen, this generated 20+ identical messages per tick, flooding the activity log.Fix: Added a module-level
Set<string>(loggedPausedConversions) that tracks which element conversions have already been logged. Each paused conversion is logged only once — on the first tick it becomes paused. A cleanup pass removes entries for conversions that are no longer paused, so they get re-logged if they pause again later.Changes:
src/lib/game/stores/gameStore.ts— AddedloggedPausedConversionsSet, wrapped the log call in a dedup check, added cleanup loop for un-paused conversionssrc/lib/game/__tests__/paused-conversion-dedup.test.ts— New regression test with 4 test cases covering: single-log-per-pause, no-duplicate-across-ticks, re-log-after-unpause, and zero-logs-when-all-activeVerification: All 60 test files (1094 tests) pass, including 4 new regression tests. File size: 399 lines (under 400-line limit).