-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarfiy opaque id field for MIDIPort text in spec #125
Comments
For 1, isn't it enough to use inputs and outputs in MIDIAccess? That's maplike<DOMString, MIDIPort>, and the key DOMString is id. |
With maplike, I think we are required to use string equality for the keys, correct? If so, then I can't hand out an id with extra data and/or hints embedded in it, which I need to help me find a match of the hardware. Here is a concrete scenario with non-opaque ids:
So we can provide a separate |
I think we should not expose physical information detail that indicates device connection tree in favor of privacy concern. Another extreme idea on the port id vs privacy is #48. So the id is expected to be some kind of hash that is generated from information, hardwareId, hardwarePath, and so on in your case. When a user reconnect the same device to another USB port, a user may expect that the device is identified as a different one, or at least he/she will accept the truth that system can not identify the device as expected. Rephrasing it, if I want to use the same two devices on DAW, I will handle them carefully so that the DAW can handle them correctly. I will never expect that DAW can handle it correctly when I swapped the connected port. I think your use case that the same port in different port should be identified as the same device is not common. Also, in such use case, a user may want to use name+manufacturer+version. |
|
Ok. I think I see how the text makes sense for point 1. Thanks for bearing with me. |
👍 for hash. Maybe the example could state that the implementation could create a hash of port interface manufacturer, name and index for creating the id? |
Sure. That was what I meant when I wrote it, but it is clearly not saying that. :) |
The current text for
id
reads as:There are a few problems here.
id
and returns a port. We should remove the mention of this.id
every time this happens (which can happen even while the port is in theopened
state). We can't encode this into theid
and so need another place to store it anyway.id
when paths change makes it difficult to use for equality.id
, we might be leaking too much information. Here is a format I was experimenting with to encode enough info on Linux for persistence:{"addr":"24:0","canInput":true,"canOutput":true,"clientName":"QX25","name":"QX25 MIDI 1","udev":{"id_id":"usb-Alesis_QX25_STM3210-00-QX25","id_path":"pci-0000:00:14.0-usb-0:1:1.0"}}
. We probably don't want to give all this info to web sites.We should recommend that
id
be opaque and backed by an internal mechanism that does its best to follow devices as they move.The text was updated successfully, but these errors were encountered: