fix(restoreVersion): return new_version tag (#58 regression 2) #59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_mik"
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?
Summary
Closes #58 regression 2.
The dashboard
restoreVersionJS readsresult.new_version(dashboard.js:5852) to format its success toast asRestored vX as vY. The handler returned only{name, restored: true}, so the toast displayedRestored vX as undefined— which presents as "restore is broken" to the user even though the on-disk file was actually being replaced correctly.The fix has the handler list versions after the restore call and return the highest tag (the snapshot just archived from the pre-restore image — exactly what the toast wants to show).
openrpc.jsongains the explicit response schema so the contract is no longer{type: object}with no documented fields.Test plan
{collection, deck, slide, version}→{name, new_version, restored:true}.new_versionpopulated.{deck_path, slide_name, version}→ same response. Backwards compat intact.restoreVersionflow end-to-end — toast now readsRestored v005 as v014instead ofRestored v005 as undefined.cargo build --release -p hero_slides_serverclean.On regression 1 (multimodal images ignored) — not reproducible on this HEAD
After pulling herolib
f6621dee(feat(ai): extend ImageConfig with OpenRouter image-gen parameters, +flatten image_config into top-level body) which boss did not have when filing #58, multimodal image attachments work end-to-end. Verified by instrumenting the broker (temporary[s91-debug]log line, reverted before this PR) and confirming inlinerefs andtheme.tomlrefs both reach OpenRouter asmessages[0].content[].image_urlparts with correct base64 data URLs, and thatgoogle/gemini-3.1-flash-image-previewrenders distinctive synthetic logos (ZORBLAXOMEGA, KWENDARIA) into the output PNG correctly. Recommendation: boss tocd lhumina_code/hero_lib && git pulland re-test on his side.Out of scope (noted, not fixed here)
While reproducing #58 in the browser I noticed two unrelated noise sources, neither user-visible (UI catches in
try/catch) — left alone to keep this PR scoped:slide.getIncomingLinksreturnsMethod not found; the dashboard calls it 11x per load (one per slide).bg.listFolderserrors when<deck>/backgrounds/does not exist (should return empty list).Pre-existing fmt drift (not from this PR)
cargo fmt --check -p hero_slides_serverreports drift inagent.rs+ earlier lines ofrpc.rs; all pre-date this PR (HEADff1fca7). Not fixed here to keep diff scoped.🤖 Generated with Claude Code
The dashboard `restoreVersion` JS reads `result.new_version` (dashboard.js:5852) to format its success toast as "Restored vX as vY". The handler returned only `{name, restored: true}`, so the toast displayed "Restored vX as undefined" — the visible symptom behind the "history restore does no longer work" report in #58. The actual on-disk restore was always working (verified via curl + md5). This change has the handler list versions after the restore call and return the highest tag — that's the snapshot just archived from the pre-restore image, which is exactly what the toast wants to show. openrpc.json gains an explicit response schema so the contract is no longer "object" with no fields. Closes #58 regression 2 of 2. Regression 1 (multimodal images ignored) cannot be reproduced on this HEAD once herolib `f6621dee` is pulled — verified via inline + theme refs end-to-end with broker-side body inspection; Gemini renders the attached image correctly. Signed-off-by: mik-tf