fix(gl): report quickstart registration failure when the node returns no UCAN (#355) - #458
beardthelion wants to merge 1 commit into
Conversation
… no UCAN (Gitlawb#355) A 2xx with a non-JSON or ucan-less body still printed "Registered successfully / UCAN saved to ..." while nothing was written, and left a stale ucan.json from another node in place. Print the success lines only when a UCAN was actually persisted.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughWalkthrough
ChangesQuickstart registration
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Quickstart now reports registration failure for unusable responses while preserving the existing continuation behavior, with no identified merge-blocking impact. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Resolution When a 2xx registration response has no usable UCAN, remove or invalidate an existing
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR corrects
Confidence Score: 5/5The PR appears safe to merge and correctly prevents a no-UCAN response from being reported as successful registration. The new branch accurately reflects whether a usable UCAN was saved and preserves the command’s established behavior of continuing after registration failures; no actionable regression was identified.
|
| Filename | Overview |
|---|---|
| crates/gl/src/quickstart.rs | Aligns registration status output with the existing UCAN persistence guard while preserving quickstart’s intentionally non-fatal control flow. |
Reviews (1): Last reviewed commit: "fix(gl): report quickstart registration ..." | Re-trigger Greptile
Summary
gl quickstartprinted "Registered successfully" and "UCAN saved to ..." on any 2xx from/api/register, including a non-JSON body whereresp.json()falls back toValue::Null. Nothing was written, and a staleucan.jsonfrom another node stayed in place while the output claimed success.Motivation & context
Closes #355
Kind of change
What changed
crates/gl/src/quickstart.rs: the success lines moved inside the!ucan.is_empty()guard that already covered the write. A 2xx with no usableucannow prints a failure row with a retry hint instead.How a reviewer can verify
Ran the built binary against a stub node returning
200 text/htmlon/api/register:Registered successfully/UCAN saved to <path>with noucan.jsonwrittenRegistration returned no UCAN (unexpected response body), still noucan.json, exit continues to step 3 as beforecargo test -p glBefore you request review
cargo test -p glpasses locallycargo fmt --allandcargo clippy -p gl --all-targets -- -D warningsare cleanfeat(...),fix(...),docs(...)).env.exampleupdated if behavior or config changed (or N/A)Protocol & signing impact
did:key, Ed25519 / RFC 9421 signatures, UCAN, ref certs, or P2P wire formatsNotes for reviewers
Overlaps the #354 fix PR in
quickstart.rs's register arm: whichever merges second needs a small rebase.Summary by CodeRabbit
gl quickstarthandling when registration succeeds without a usable UCAN.