Skip to content

fix: persist session across refresh + PWA icon 404 (#9)#10

Merged
opariffazman merged 4 commits into
mainfrom
fix/persistence-and-pwa-icons
May 28, 2026
Merged

fix: persist session across refresh + PWA icon 404 (#9)#10
opariffazman merged 4 commits into
mainfrom
fix/persistence-and-pwa-icons

Conversation

@opariffazman

Copy link
Copy Markdown
Owner

Summary

  • Refresh wiped all git state. Root cause: autoLoad/deserialize and saveHistory/loadHistory were all defined but never called — every boot created a fresh empty GitEngine, while autoSave happily wrote state nothing ever read back. Added hydrate() (called once from main.ts) to restore engine state + command history on boot, and persist history after each command.
  • PWA manifest icons 404'd (PWA manifest icons 404 — absolute paths ignore /gitverse/ base #9). Icon src used leading-slash absolute paths (/icons/...) that resolve to the domain root, missing the /gitverse/ project subpath. Switched to relative paths so they resolve against the manifest URL.

Test plan

  • New regression tests tests/store/engine.test.ts — restore / no-save / corrupt-save / history restore / history persist (wrote failing first)
  • Full suite: 337 passed (17 files)
  • npm run typecheck — 0 errors
  • npm run lint + format:check — clean
  • npm run build — generated manifest now emits "src":"icons/icon-192.svg" with "scope":"/gitverse/"
  • Manual: run a few git commands, refresh browser, confirm DAG/branches/files/history persist

Closes #9

🤖 Generated with Claude Code

opariffazman and others added 3 commits May 28, 2026 10:58
autoLoad/deserialize and saveHistory/loadHistory all existed but were
never wired, so every refresh started from a fresh empty engine and lost
all git state. Add hydrate() (called once on boot from main.ts) to restore
engine state and command history, and persist history after each command.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Manifest icon src used leading-slash absolute paths (/icons/...) that
resolve to the domain root and 404 on the GitHub Pages project subpath.
Use relative paths so they resolve against the manifest URL under
/gitverse/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-28 03:40 UTC

Addresses PR #10 review:
- await hydrate() before mount so the graph and terminal render already
  populated and no early command can race the restore (was fire-and-forget)
- replace the "git init to begin" banner with a restored-session notice so
  the terminal no longer contradicts a populated graph
- guard saveHistory/loadHistory against storage failures, matching
  autoSave/autoLoad, so a floating saveHistory can't emit an unhandled rejection
- reset the history store between tests for order-independence

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@opariffazman
opariffazman merged commit 5dcada2 into main May 28, 2026
3 checks passed
@opariffazman
opariffazman deleted the fix/persistence-and-pwa-icons branch May 28, 2026 03:40
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.

PWA manifest icons 404 — absolute paths ignore /gitverse/ base

1 participant