Sb/2c token health - #108
Merged
Merged
Conversation
added 2 commits
September 29, 2026 16:26
… defense and injuries The token's columns keep the running system's values, so combat, damage, the health monitor and linked sheet fields are unchanged; the other systems' values wait in token_vitals. tokens/vitals.js switchSystem swaps them and writes game_system in one transaction, reading the system being left inside it, so a failure or two quick switches can never split tokens from the setting. The system picker route uses it and has every screen redraw; the generic settings route can no longer change game_system or the migration markers. A one-time start (startup/tokenVitals.js, adds rows only, run once) saves each token's current values under every system it could be shown in. Map clears and loads drop saved values for tokens that are gone, since they wind the id sequence back. Tests mutation-checked (restore, transaction, systems, settings guard, prune). Verified on a read-only copy of the real database: 18 tokens switched away and back came back identical.
…own folder It matched the folder name MapSystem, which is only in a Windows checkout's path: on the CI runner it cleared nothing, the second open of db.js returned the first, closed connection, and the test failed with "Database is closed". It now matches the backend directory as resolved, says so plainly if db.js was not cleared, and waits for the first open's startup work (tokens/vitals whenReady) before closing it.
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.
Summary
Test plan
Pre-merge checklist
Code quality:
Version & Release:
frontend/package.jsonversiondocker-compose.ymlAPP_VERSIONCHANGELOG.mdwith release notesBefore merging to main:
Related issues