fix: owner_id was stored as string when recovered from settings on restart#2561
Conversation
…start Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request modifies the register_channel function in src/channels/wasm/setup.rs to attempt parsing the owner_id as an integer before defaulting to a string representation in the configuration updates. The test suite has been updated to reflect this change by asserting the owner_id as a numeric value. I have no feedback to provide.
There was a problem hiding this comment.
Pull request overview
Fixes a WASM channel startup failure caused by injecting owner_id into channel runtime config as a JSON string instead of a JSON number (notably impacting Telegram after restart when owner_id is recovered from settings).
Changes:
- Coerce
owner_idinto a numericserde_json::Valuewhen the resolved owner ID is parseable as an integer; otherwise keep it as a string. - Update the affected test assertion to expect a numeric JSON value for
owner_id.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
fixes an elusive bug introduced in #2515 |
|
Thank you so much for catching/fixing this! Really appreciate it |
henrypark133
left a comment
There was a problem hiding this comment.
Review: telegram owner_id recovery fix looks sound
I verified the checked-out change in src/channels/wasm/setup.rs:227: runtime config now goes through build_runtime_config_updates(...), so a recovered numeric owner_id stays a JSON number instead of being stringified on restart. The added regression test covers the settings-recovery case that broke Telegram startup.
Residual risk: I did not rerun the full WASM/channel suite in this pass; review here is based on code inspection plus the focused regression coverage in the diff.
Summary
Change Type
Validation
cargo fmt --all -- --checkcargo clippy --all --benches --tests --examples --all-features -- -D warningscargo buildcargo test --features integrationif database-backed or integration behavior changedreview-prorpr-shepherd --fixwas run before requesting reviewSecurity Impact
None
Database Impact
None
Blast Radius
Fixes telegram channel
Review track: A (small fix)