-
Notifications
You must be signed in to change notification settings - Fork 101
Calling deployQZ() again #107
Comments
If we are just setting His keepAlive variable works, but we also need to reset |
@bberenz thanks for the feedback. So the websocket functions/properties should all invalidate automatically with our existing code, right? How about this approach? #108 |
Yes, as soon as the websocket closes, any further calls will result in an error caused by a CLOSED state. #108 looks good to take care of this. |
|
From our client:
(I've incorporated the client's changes here tresf@4f01ec8) First, I tested the scenario where keepAlive is null and can confirm that clearInterval throws an error, so I believe that check is good. :) Second, I also agree with the part where a valid websocket throwing an error may not be grounds for a self-destruct alone. In practice this may be a bit different. We'll have to test this thoroughly on all browsers to see how they behave. Third, logic tells me that this is a typo. Reason I say this is that outOfBounds should always fire a self-destruct, so I'm not sure what was the reasoning behind this line was. @bberenz can you help clear this up? So, I've committed the changes so far to my personal branch via https://github.com/tresf/qz-print/commit/4f01ec8f0950838d9335e71680e653082a007f5e. |
The websocket's This was also set up before we had the |
@bberenz sorry, I linked the wrong line... Here: https://github.com/qzind/qz-print/blob/1.9/js/qz-websocket.js#L88 |
I believe that one was added for the same reason, but because |
Ok, I won't beat it up further since 2.0 rewrites a lot of this code anyway. I'll squash and merge these changes and get them tested prior to the 1.9.5. roll-out. Thanks for the review. |
@bberenz we have a client requesting to call
deployQZ()
a second time after the tray software has been started.These are the proposed changes to the
qz-websocket.js
:I wonder if there is a better approach to this. I've already reset the counter via bf51347, but the above concerns seem to be pretty valid about cleaning up the lingering resources.
Here are the client's proposed diffs...
qz-websocket.js
The text was updated successfully, but these errors were encountered: