jamulus icon indicating copy to clipboard operation
jamulus copied to clipboard

JSON-RPC: Add client method to set instrument

Open hoffie opened this issue 3 years ago • 11 comments

Raised by @softins in https://github.com/jamulussoftware/jamulus/pull/1975#pullrequestreview-901000643

I must admit I struggle to understand a reason for making skillLevel changeable via the RPC, but not an instrument. I would only ever need to change my skill level if I was also changing my instrument, as my skill level on a given instrument is pretty static! [...] we need to be able to set the user's instrument. In fact, the complement to jamulusclient/getChannelInfo maybe should be jamulusclient/setChannelInfo for consistency?

Has this feature been discussed and generally agreed?

I assume agreement that a way for setting the instrument should be added. There's no agreement on the particular implementation yet.

Describe the solution you'd like

  1. Add jamulusclient/setInstrument and keep setName and setSkillLevel
  • :+1: Most fine-grained solution
  • :+1: Saves the API user from having to request and (re)set all existing, unchanged values
  • :-1: Amount of code
  1. Add jamulusclient/setChannelInfo and drop setName and setSkillLevel
  • :+1: Consistent with getChannelInfo
  • :+1: Uses a single protocol message instead of one per change
  • :-1: Requires API users to request the current data first and pre-fill the fields which should not be changed. Maybe we could make the fields optional, though?

I'd go with (2). I read @pljones' https://github.com/jamulussoftware/jamulus/pull/1975#issuecomment-1059839552 as also supporting that approach. Edit: Based on the feedback below, (2) is the generally agreed approach.

hoffie avatar Mar 07 '22 20:03 hoffie

Requires API users to request the current data first and pre-fill the fields which should not be changed. Maybe we could make the fields optional, though?

Yes. Assuming that non existent != setting the respective field to the empty string.

ann0see avatar Mar 07 '22 21:03 ann0see

Requires API users to request the current data first and pre-fill the fields which should not be changed. Maybe we could make the fields optional, though?

Yes. Assuming that non existent != setting the respective field to the empty string.

I would agree. Allow a subset of the params to be given, and only change the ones that were given.

softins avatar Mar 08 '22 18:03 softins

I think we have an agreement here.

So this issue should mark (2) as agreed.

ann0see avatar Mar 09 '22 06:03 ann0see

I would agree. Allow a subset of the params to be given, and only change the ones that were given.

We'd have to keep it possible to "clear" the value of a field.

pljones avatar Mar 09 '22 08:03 pljones

I would agree. Allow a subset of the params to be given, and only change the ones that were given.

We'd have to keep it possible to "clear" the value of a field.

Absolutely. The request to do that would need to include "field": "" or "field": null as appropriate.

softins avatar Mar 09 '22 16:03 softins

@softins @hoffie any updates here?

ann0see avatar Apr 11 '22 20:04 ann0see

I'm going to be trying to split out all the "moving to client (and server) what should be in client (and server) rather than UI" code from my settings stuff at some point (but after patch/server-listfilter-logging as it will part of refactoring feature/next-big-thing-for-settings into consumable chunks).

I also think @pgScorpio has some changes that may require exposing these "client" operations.

I'd suggest a plan to do them on a "protocol message at a time" basis - i.e. separate PRs for each change covering one message.

pljones avatar May 22 '22 09:05 pljones

Moving to 3.9.1. Hopefully more JSON-RPC progress can be made.

pljones avatar Jun 18 '22 11:06 pljones

Bumping as notabug.

pljones avatar Aug 29 '22 16:08 pljones

Removing the milestone and moving to Triage as no one seems interested in picking it up.

pljones avatar Apr 19 '23 14:04 pljones