openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

fix(logging): print stored RPC URL as string in configPersistence

Open leighstillard opened this issue 6 months ago • 3 comments

Summary

  • Fixes [configPersistence] Stored RPC URL: [object Object] in CEF's chrome_debug.log.
  • The second console.debug arg was a wrapper object ({ url: url.trim() }). DevTools expands objects inline; CEF's file-backed log stringifies them, yielding [object Object].
  • Passing the URL primitive directly gives a useful log line: [configPersistence] Stored RPC URL: tauri://localhost/....

This is issue B from triage issue #2437.

Why this matters

Self-diagnosis of the larger remote-core attach-mode bug (issue A in #2437) is currently blocked because the stored RPC URL is invisible in logs. Fixing the printer makes the next round of diagnostics actionable.

Change

Single-line edit in app/src/utils/configPersistence.ts:88. No tests asserted on the prior log shape; no test changes required.

Test plan

  • [x] pnpm typecheck — clean.
  • [x] pnpm exec eslint app/src/utils/configPersistence.ts — clean.
  • [x] pnpm exec prettier --check app/src/utils/configPersistence.ts — clean.
  • [x] N/A: Manual Windows verification — deferred to post-merge. The change is a single-line log-format fix with no behavior change; CEF stringification of objects vs. primitives is well-defined, and the next Windows run on main will surface the corrected log line in chrome_debug.log for issue A diagnosis.

Pre-push hook note

Pushed with --no-verify. The hook failed on two unrelated pre-existing issues on main:

  • cargo check --manifest-path src-tauri/Cargo.toml exits 101 in the Tauri shell (not touched by this PR).
  • lint:commands-tokens ripgrep matches in src/components/commands/ (not touched by this PR).

Per CLAUDE.md (Git workflow → "If a pre-push hook fails on something unrelated to your changes ... push with --no-verify and call it out in the PR body").

Summary by CodeRabbit

  • Chores
    • Updated internal debug logging for improved development diagnostics.

Note: This release contains minimal user-facing changes, focusing on internal improvements.

Review Change Stack

leighstillard avatar May 21 '26 10:05 leighstillard

📝 Walkthrough

Walkthrough

This PR updates a debug logging statement in RPC URL persistence: the console output changed from logging an object ({ url: url.trim() }) to logging the trimmed URL string directly. No functional behavior, storage logic, or public APIs were altered.

Changes

RPC URL Debug Logging Format

Layer / File(s) Summary
Debug logging format for RPC URL storage
app/src/utils/configPersistence.ts
Updated the storeRpcUrl function's debug output to log the trimmed URL as a plain string rather than as a named property within an object.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A log line grows lean and clean,
From objects wrapped to strings pristine,
No secrets lost in this small change,
Just clearer view of what we save—
Debugging whispers, calm and brave.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: fixing debug logging to print the stored RPC URL as a string instead of an object in configPersistence.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar May 21 '26 10:05 coderabbitai[bot]

@leighstillard CI is failing on changes in this PR — please fix before review.

M3gA-Mind avatar May 21 '26 17:05 M3gA-Mind

Fixed I think

leighstillard avatar May 22 '26 00:05 leighstillard