slide.getIncomingLinks not implemented + bg.listFolders errors on missing dir #60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Two unrelated noise sources surfaced while reproducing #58 in the dashboard via Hero Browser MCP. Neither is user-visible (the JS catches in
try/catch), but both pollute the slides server logs on every dashboard load, and one represents a half-shipped feature.1.
slide.getIncomingLinks— Method not foundThe dashboard calls this RPC once per slide on every
loadSlidesForDeck()(crates/hero_slides_admin/static/js/dashboard.js:2872) to render the "used as link source in N place(s)" badge introduced alongside D-09 / PR #55. For sample_deck (11 slides) every dashboard load fires 11 failing RPCs.The handler is not registered in
crates/hero_slides_server/src/rpc.rsdispatcher and there is noslide_get_incoming_linkslib helper either. The UI catches and silently drops the error, so the badge just never appears — but the server logs every failure.Two reasonable fixes — pick whichever fits the team intent:
state.registry.lookup_root(&col)),load_metadatafor each, scanmetadata.slides[*].source_linkfor entries whosedeck_path+slide_namematch the queried slide. Return{incoming_links: [{deck_path, slide_name}]}. ~30 LOC.(A) is the more useful endpoint per D-09's link-graph intent.
2.
bg.listFolders— error when<deck>/backgrounds/does not existReproducer:
Should return an empty
{folders: []}instead of erroring when the directory is absent. "No backgrounds" is the expected steady state for new decks; the only legitimate error is "deck path does not exist".Why these were not fixed in PR #59
PR #59 closes #58 regression 2 (
restoreVersiontoast UX). I deliberately kept that PR scoped to the one named regression. These two issues are real but separate — filing here so they don't get lost.Signed-off-by: mik-tf
Closed by #61 — squash-merged as
f34f18aondevelopment.Resolution
1.
slide.getIncomingLinks— implemented (Option A from issue body). New handler walks every deck under the same collection root, loadsmetadata.toml, scansslides.*.source_link, and returns{collection, deck, slide}matches. Dashboard "used as link source in N place(s)" badges now render; the ~11x-per-loadMethod not foundserver log spam is gone.2.
bg.listFolders— now returns{folders: [], root_files: []}when the target dir is absent instead of-32000. Matches the issue's stated expected behavior.Verified locally before merge
python3 scripts/smoke_openrpc.py— 91 methods, METHOD_MISSING 0.hero_slides_intro/07_s92_link_probe→sample_deck/01_intro,getIncomingLinksreturns the linker, deleted probe after.Latent finding (not fixed here)
legacy_param_shimsynthesizespath = <deck_path>/backgroundsfor allbg.*methods atrpc.rs:399, but the lib helpers appendcontent/background/to whatever they receive. The synthesized path therefore never matches the actual filesystem layout — after this PRbg.listFoldersalways returns empty until the shim is reconciled. Not user-visible (UI catches errors in try/catch and would render empty anyway), but a follow-up issue may be worth filing if anyone tries to usebg.uploadFile/bg.createFolder/ etc. and discovers they're writing into a non-existent<deck>/backgrounds/content/background/path.Signed-off-by: mik-tf