Closed bohdankovt closed 1 day ago
Hi! I think that's because you need to send at least one packet to the client, in order to initialize the offset. I will make it clearer in the documentation.
Edit: or it might be related to https://github.com/socketio/socket.io-mongo-adapter/commit/1a0488562f1e8b4171af20378aacfa43072980dd. Let me publish a new version with the fix.
Could you please check with version 0.3.1
?
In my tests server always send at least one packet to client.
Seems problem with version of node mongodb driver. I tried to setup adapter with mongo version 5
and mongodb driver version 6.3.0
(latest), but it was not worked. After that i tried to downgrade mongodb driver to version 5.0
but it was not worked too. Only on mongodb driver version 4
it worked correctly.
Also i forked your repo and tried to run your tests with debug. I saw that all tests for connection state recovery mechanizm are passed but when i enable debug mode i saw that adapter logs to console error on recovering steps. It seems tests not working as expected.
I think you should add compatability table to readme file for supported mongo versions and mongodb driver.
I think this should be fixed by https://github.com/socketio/socket.io-mongo-adapter/commit/d3fa03874038ed9ec011d8795ac7dc6d840f4abe, included in version 0.3.2. Could you please check?
The fix works, so issue can be closed. Thanks.
Connection state recovery not working
mongo 5.0 mongodb: 6.3.0 socket.io: 4.6.1 socket.io-mongo-adapter: 0.3.0
client:
server:
createAdapter: