-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Order not preserved while sending data #746
Comments
The same has been happening with me. The second to last chunk is always received before the last one. |
Yeah. It's not setting the DC to ordered unfortunately. Having the same issue. |
This comment was marked as outdated.
This comment was marked as outdated.
## [1.4.8-rc.1](v1.4.7...v1.4.8-rc.1) (2023-02-25) ### Bug Fixes * `close` event was not triggered reliably ([#860](#860)) ([ec1d5ae](ec1d5ae)), closes [#636](#636) * **datachannel:** sending order is now preserved correctly ([18d491a](18d491a)), closes [#746](#746) * **deps:** update dependency @swc/helpers to ^0.4.0 ([a7de8b7](a7de8b7)) * **deps:** update dependency eventemitter3 to v5 ([caf01c6](caf01c6)) * **deps:** update dependency webrtc-adapter to v8 ([431f00b](431f00b)) * **npm audit:** Updates all dependencies that cause npm audit to issue a warning ([6ef5707](6ef5707))
🎉 This issue has been resolved in version 1.4.8-rc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I published a new beta release that should respect the ordering (except for You can get it on npm via npm i peerjs@rc |
Thanks a lot! |
Please don’t feel obligated to try, but maybe you could call const file : File = ....
const ab : ArrayBuffer = await file.arrayBuffer();
dataConnection.send(ab) We could also make |
I was having an ordering issue but I thought it had to do with UDP... there are many data packets being transferred between two peers, and sometimes it gets out of order very quickly, or it gets out of order after a few hundred packets. I forced communication through TURN and used TCP channel, and the issue was resolved, as far as I could tell. I am assuming it was still a UDP issue but after reading this issue - is it possible it could have been this issue -- or does this issue only occur at the very "end" of the data channel communications (??) (Also my presumption is that UDP packets can get dropped anywhere along the way, whereas TCP will ensure it gets to the other side) |
Hi @brianismeta, WebRTC’s data channels use SCTP, not UDP or TCP. If your issue gets resolved when using a "TCP channel", you are probably not affected by this issue. If not, please give the beta version a try. |
This upgrades `binarypack` to version 2. `pack` now returns `ArrayBuffer`s which can be sent over all data channel types without asynchronous conversion. This implementation is also much faster than version 1. Closes #746
# [1.5.0-rc.1](v1.4.8-rc.1...v1.5.0-rc.1) (2023-08-14) ### Bug Fixes * **datachannel:** sending order is now preserved correctly ([#1038](#1038)) ([0fb6179](0fb6179)), closes [#746](#746) * **deps:** update dependency peerjs-js-binarypack to v1.0.2 ([7452e75](7452e75)) * **deps:** update dependency webrtc-adapter to v8.2.2 ([62402fc](62402fc)) * **deps:** update dependency webrtc-adapter to v8.2.3 ([963455e](963455e)) * **MediaConnection:** `close` event is fired on remote Peer ([0836356](0836356)), closes [#636](#636) [#1089](#1089) [#1032](#1032) [#832](#832) [#780](#780) [#653](#653) ### Features * **DataConnection:** handle close messages and flush option ([6ca38d3](6ca38d3)), closes [#982](#982) * **MediaChannel:** Add experimental `willCloseOnRemote` event to MediaConnection. ([ed84829](ed84829)) * MsgPack/Cbor serialization ([fcffbf2](fcffbf2))
🎉 This issue has been resolved in version 1.5.0-rc.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.5.0](v1.4.7...v1.5.0) (2023-09-03) ### Bug Fixes * **datachannel:** sending order is now preserved correctly ([#1038](#1038)) ([0fb6179](0fb6179)), closes [#746](#746) * **deps:** update dependency @swc/helpers to ^0.4.0 ([a7de8b7](a7de8b7)) * **deps:** update dependency cbor-x to v1.5.4 ([c1f04ec](c1f04ec)) * **deps:** update dependency eventemitter3 to v5 ([caf01c6](caf01c6)) * **deps:** update dependency peerjs-js-binarypack to v1.0.2 ([7452e75](7452e75)) * **deps:** update dependency webrtc-adapter to v8 ([431f00b](431f00b)) * **deps:** update dependency webrtc-adapter to v8.2.2 ([62402fc](62402fc)) * **deps:** update dependency webrtc-adapter to v8.2.3 ([963455e](963455e)) * **MediaConnection:** `close` event is fired on remote Peer ([0836356](0836356)), closes [#636](#636) [#1089](#1089) [#1032](#1032) [#832](#832) [#780](#780) [#653](#653) * **npm audit:** Updates all dependencies that cause npm audit to issue a warning ([6ef5707](6ef5707)) ### Features * `.type` property on `Error`s emitted from connections ([#1126](#1126)) ([debe7a6](debe7a6)) * `PeerError` from connections ([ad3a0cb](ad3a0cb)) * **DataConnection:** handle close messages and flush option ([6ca38d3](6ca38d3)), closes [#982](#982) * **MediaChannel:** Add experimental `willCloseOnRemote` event to MediaConnection. ([ed84829](ed84829)) * MsgPack/Cbor serialization ([fcffbf2](fcffbf2)) * MsgPack/Cbor serialization ([#1120](#1120)) ([4367256](4367256)), closes [#611](#611)
## [1.5.2-rc.1](v1.5.1...v1.5.2-rc.1) (2023-12-03) ### Bug Fixes * `close` event was not triggered reliably ([#860](#860)) ([ec1d5ae](ec1d5ae)), closes [#636](#636) * **datachannel:** sending order is now preserved correctly ([18d491a](18d491a)), closes [#746](#746) * support Blobs nested in objects ([7956dd6](7956dd6)), closes [#1163](#1163)
## [1.5.3-rc.1](v1.5.2...v1.5.3-rc.1) (2024-04-27) ### Bug Fixes * `close` event was not triggered reliably ([#860](#860)) ([ec1d5ae](ec1d5ae)), closes [#636](#636) * **datachannel:** sending order is now preserved correctly ([18d491a](18d491a)), closes [#746](#746) * navigator is not defined ([305a180](305a180)) * navigator is not defined. ([6f85dd3](6f85dd3)) * remove need for `unsafe-eval` ([f1857fe](f1857fe))
This is a part of my code that I am using to transfer files.
When this data is received on the other user's end then I print the idx received and all of them are in the right order except the last two.
Example -
0
1
2
.
.
.
207
209
208
This is happening for all the files but most of the files are opening without any problem while some of them are not.
I tried setting the ordered attribute to true but it still remained false -
The text was updated successfully, but these errors were encountered: