-
Notifications
You must be signed in to change notification settings - Fork 200
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
fix: do not send package via outdated session #1559
fix: do not send package via outdated session #1559
Conversation
Signed-off-by: Niall Shaw <[email protected]>
return Object.values(this.transportSessionTable).filter( | ||
(session) => session?.connectionId === connectionId && session.type === 'WebSocket' | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can limit it to one session per type and connection id? That way we don't have to add web socket specific logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm happy with that also. Bug was only found in WebSocket, that's why I made it this way, but happy to change :)
FYI - this bug was found using AFJ 0.3.3, so perhaps it is not relevant anymore, but I can't see why it wouldn't be. |
Signed-off-by: Niall Shaw <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1559 +/- ##
=======================================
Coverage 85.73% 85.73%
=======================================
Files 950 950
Lines 22745 22753 +8
Branches 3978 3981 +3
=======================================
+ Hits 19500 19508 +8
Misses 3060 3060
Partials 185 185
|
@TimoGlastra - adjusted for any type |
…1559) Signed-off-by: Niall Shaw <[email protected]> Signed-off-by: Eric Vergnaud <[email protected]>
…1559) Signed-off-by: Niall Shaw <[email protected]> Signed-off-by: Ariel Gentile <[email protected]>
…1559) Signed-off-by: Niall Shaw <[email protected]> Signed-off-by: Martin Auer <[email protected]>
…1559) Signed-off-by: Niall Shaw <[email protected]> Signed-off-by: Martin Auer <[email protected]>
We found an edge-case where a websocket transport session would be closed/unavailable on the client agent side, but mediator still thinks it is available (due to client being offline).
When client returns back online and initiates a flow via mediator, the mediator will attempt to send the package to the now outdated websocket, instead of the newest / current session.
This PR fixes the problem, but is there any reason why a single connection may need multiple open WebSocket transport sessions?