onmidimessage called after a port has been closed
Categories
(Core :: DOM: Device Interfaces, defect, P2)
Tracking
()
People
(Reporter: padenot, Unassigned)
References
(Blocks 1 open bug)
Details
We have a report of onmidimessage still being called after close has been called, maybe something is off, we should invetigate.
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Do we have an STR for this? I've double-checked the code and I've verified that:
- We check if a port is open before delivering a message
- Closing a port is async and we resolve the closing promise only after the port has been closed on the content side
So in theory it's impossible for us to deliver messages after a port is closed. It is possible that onmidimessage()
gets called between a call to MIDIPort.close()
and the resolution of the returned promise but that's to be expected since the API is asynchronous.
Comment 2•3 years ago
|
||
I made a local test where a page sends messages in a loop to a through port and another page listens to them. As soon as I call MIDIPort.close()
on the input port in the receiving page I can see that onmidimessage()
stops being called. So I'm confident that at least in a simple scenario this works as expected.
Reporter | ||
Comment 3•3 years ago
|
||
Ok, we can probably close this, I'll follow up with the reporter (via email).
Updated•3 years ago
|
Description
•