Replies: 4 comments
-
Hi! That's a great question. The reasoning was that by ignoring packets with acknowledgements, we ensure that all adapters behave the same and there are no discrepancies between local and production environments, which may use a different adapter. |
Beta Was this translation helpful? Give feedback.
-
@darrachequesne So you're saying that other adapters also lack support for delivering messages with acknowledgments after state recovery? I'm trying to use acknowledgements to check whether a certain message was received by a client or not. Also, I am using connection state recovery to increase the reliability of the message being delivered. Do you think it’s even possible to achieve both of these goals simultaneously? |
Beta Was this translation helpful? Give feedback.
-
@darrachequesne Hey Damien, I'm still looking forward to your answer on the above. |
Beta Was this translation helpful? Give feedback.
-
From what I understood the
in-memory-adapter
should not be used when running multiple SocketIO servers. However when you look at the code of theSessionAwareAdapter
, you can see that it does not resend packets that have acknowledgements:socket.io/packages/socket.io-adapter/lib/in-memory-adapter.ts
Lines 479 to 498 in 7427109
The reason provided by the comment is:
"packets with acknowledgement are not stored because the acknowledgement function cannot be serialized and restored on another server upon reconnection"
However this doesn't make sense as when using the SessionAwareAdapter we are already sure we only have a single SocketIO server running.
I am currently working on a project in which I need to resend not only messages without acknowledgements but messages with acknowledgements as well.
I wanted to understand the reason behind this and if this was made in error and can be removed I would like to make a PR to fix it.
Beta Was this translation helpful? Give feedback.
All reactions