Skip to content

fix(titles,restore): spawn titles via spoof config, consolidate state onto Roaming - #14

Closed
bitsfdb wants to merge 1 commit into
mainfrom
fix/title-spawn-restore-state-consolidation
Closed

bitsfdb wants to merge 1 commit into
mainfrom
fix/title-spawn-restore-state-consolidation

Conversation

@bitsfdb

@bitsfdb bitsfdb commented Nov 27, 2026

Copy link
Copy Markdown
Owner

What

Fixes the two title bugs from the last build and cleans up where state lives.

Titles

  • Spawned titles now live in a spawned_titles list in the spoof config, saved like name_spoof (no more title_ids.json sidecar, no more spawn-shaped title swaps).
  • spawned_title_ids() = spawned_titles + each title-swap equip_title_id, so swaps still resolve.
  • Newly spawned titles are pushed into the running game via inject_title_reward_drop (Reward/RewardResult frame), same as items — they appear immediately instead of only after a match.
  • One-time migration folds title_ids.json and spawn-shaped title swaps into spawned_titles.

Restore

  • Despawn and Restore All now remove titles. Restore All clears titles first (a missing game dir can't skip it), counts them in its summary, and title rows render even before a game dir is set.
  • The backup-list refresh is queued instead of dropped when one is already running, so the list isn't left stale right after a restore.

State consolidation

  • canonical_swaps_paths() is Roaming-only. cleanup_stale_state_files() runs once at startup, folds stale swaps.json / title_ids.json from %LOCALAPPDATA% and bare %APPDATA%\VelocityRL\ into the canonical Roaming files, then deletes those stale copies. Never touches the webview cache or the Tauri dir.
  • This stops restored items resurrecting from stale fallback copies.

Not verified

  • No local Rust toolchain — relying on CI for cargo check --release and cargo test. UI passed node --check.
  • Live title push and the startup file cleanup need a real Windows + game test.
  • Pre-existing CI failure test_emulate_unboxing_pipeline_and_garage_series_filter_safety (a test race) is unrelated to this branch and already red on main.

…date state onto Roaming

Titles previously lived in a title_ids.json sidecar and, in the last build,
as spawn-shaped title swaps the Restore path never cleared — so restored
titles kept coming back, and a spawned title only appeared after a match
re-downloaded the inventory.

- Move spawned titles into a `spawned_titles` list in the spoof config,
  saved like name_spoof. spawned_title_ids() = spawned_titles + title-swap
  equip ids, so swaps still resolve.
- Push newly spawned titles into the running game via inject_title_reward_drop
  (Reward/RewardResult frame), same as items, so they show up immediately.
- Despawn and Restore All now remove titles; Restore All clears them first so
  a missing game dir can't skip it, counts them in its summary, and title rows
  render even before a game dir is set.
- One-time migration folds title_ids.json and spawn-shaped title swaps into
  spawned_titles.
- Consolidate swaps.json onto the two Roaming dirs: canonical_swaps_paths() is
  Roaming-only and cleanup_stale_state_files() folds stale LOCALAPPDATA and
  bare-%APPDATA%\VelocityRL copies into the canonical files at startup, then
  deletes them (never the webview cache or the Tauri dir). This stops restored
  items resurrecting from stale fallback copies.
- Queue a backup-list refresh instead of dropping it when one is already
  running, so the Restore list isn't left stale right after a restore.
Copilot AI balanced review requested due to automatic review settings November 27, 2026 08:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@bitsfdb bitsfdb closed this Nov 27, 2026
@bitsfdb
bitsfdb deleted the fix/title-spawn-restore-state-consolidation branch November 27, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants