fix: memoize RTCDataChannel fields#347
Conversation
Stores local copies of the id, label and protocol fields for RTCDataChannel polyfill objects. This is because libdatachannel throws if these fields are accessed on a DataChannel after it's been closed, but browsers allow access so brings the polyfill in line with other implementations.
|
it's one of the things i fixed in ##324 ;-; |
|
@murat-dogan Can you merge this please? |
|
Hello @achingbrain , I am not sure about the tests. I think just a basic polyfill test will be enough. |
|
@achingbrain @murat-dogan After applying the readyState fix #359 and run the build workflows, this test "it can access datachannel informational fields after closing" is failing with a timeout, but only on macOS (x64). Interestingly, the same test passes without issues on the Linux builds. It's a bit puzzling. You can see the Build - Mac x64 failure here: |
|
After re-running the workflow without any changes, the test passed on macOS (x64). I guess it was something on the GitHub Runner's side? Pretty weird. https://github.com/mertushka/node-datachannel/actions/workflows/build-mac-x64.yml |
Stores local copies of the id, label and protocol fields for RTCDataChannel polyfill objects.
This is because libdatachannel throws if these fields are accessed on a DataChannel after it's been closed, but browsers allow access so brings the polyfill in line with other implementations.