-
Notifications
You must be signed in to change notification settings - Fork 6
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: loadedMessage is not cleared after message(s) handled #102
Comments
@jtarvainen My coding days are tomorrow. I will work on this and release the other feature for AE. |
So doing so breaks up a unit test for very large messages, like getting PDF data. node-hl7-server/src/server/inbound.ts Line 139 in 9eb9a20
Already has clearing of the loadedMessage on a TCP connect. I might have to write a unit test out for this one to test out this issue. |
This could be a bug in the node-hl7-client as well. |
The client device we use keeps the TCP connection alive between messages, so we can't rely on the clear-on-connect feature. |
@jtarvainen Just so you know, I am trying to nail this down. Some major testing I been writing locally. |
@Bugs5382 Any update on this? I haven't investigated the code further, but to me it sounds like it should be OK to clear |
@jtarvainen I am still working. I tried that, and my unit tests failed hard. Maybe I am missing something. |
This fix is going to be out soon. Thanks @jtarvainen for your patience. |
@jtarvainen This has been release 3.0.1-develop |
That's great, thank you! |
Environment
Questions:
Yes
Expected Behavior
The
Inbound
instance's "data" event handler should clearloadedMessage
after handling a complete message (or batch of messages). Otherwise the variable just keeps concatenating each received message in perpetuity.Actual Behavior
loadedMessage
is never cleared, causing each previously received message to be re-handled upon reception of each new message.The fix is to add the following after row 220 in
src/server/inbound.ts
:Steps to reproduce the bug
Create a unit test where:
Assert that in step #3 the previously sent message is re-handled on the server in addition to the new message and two acknowledgments are sent to the client instead of one.
The text was updated successfully, but these errors were encountered: