Return "ok" from setSkillLevel when skillLevel is null - #3943
Conversation
The null branch of jamulusclient/setSkillLevel cleared the skill level and returned without assigning response["result"], so the reply carried neither "result" nor "error", which JSON-RPC 2.0 forbids. The method documents its result as always "ok"; now it is. Fixes jamulussoftware#3919
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: QUIET Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe ChangesSkill level reset response
Estimated code review effort: 1 (Trivial) | ~2 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Clearing a client skill level now returns the expected JSON-RPC "ok" result, preventing malformed success responses. The focused change is ready to merge. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Not going to say "no" to this... |
🤖 AI: Fixes #3919, assigned by @pljones for 4.1.0.
jamulusclient/setSkillLeveldocumentsnullas a valid value that clears the skill level, and documents its result as always"ok". Thenullbranch clears the level and returns without settingresponse["result"], so the reply carries neitherresultnorerror, which the JSON-RPC 2.0 response object forbids. A client that waits forresultwaits forever on a valid call.Short description of changes
One line:
response["result"] = "ok";before thereturnin thenullbranch, the same statementsetNameand the string branch of this method already end with.Both arms built from the same tree with and without this line, Qt 5.15.13, gcc 13.3, x86-64, client headless (
-n -i /dev/null,QT_QPA_PLATFORM=offscreen), raw reply lines from the RPC socket:skillLevelmainnull{"id":1,"jsonrpc":"2.0"}{"id":1,"jsonrpc":"2.0","result":"ok"}"expert"{"id":2,"jsonrpc":"2.0","result":"ok"}42-32602,Invalid params: skillLevel is not a string"guru"-32602,Invalid params: skillLevel is not beginner, intermediate or expertCHANGELOG: Client:
jamulusclient/setSkillLevelnow returns"ok"when called withnull, instead of a JSON-RPC response with neitherresultnorerror.Context: Fixes an issue?
Fixes: #3919
Does this change need documentation? What needs to be documented and how?
No. The documented behaviour is what the code now does.
Status of this Pull Request
Ready for review.
What is missing until this pull request can be merged?
Review.
Checklist
🤖 This message was written by AI and reviewed by @mcfnord.