-
Notifications
You must be signed in to change notification settings - Fork 276
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
Error handling when setSignaturePromise() fails #1273
Comments
Can you create a minimal example? |
Is there any boilerplate / CodePen with a setup to start from? |
I sort of asked you for this, but for sake of moving forward with this bug report:
This should be the default behavior already. If you change the above example from: return (resolve, reject) => {
- reject("foo");
+ resolve("foo");
}; ... the call should succeed. There's a chance we're not handling the rejection properly, but the default behavior seems to be what's being described in this bug report where the print does not work when the signature fails. |
Hi @tresf, thanks for your quick reply. Based on your example, if I would extend it with an
|
A signature failure is not actionable on the client-side, so it's not -- and has never been part of -- the connecting/printing/API call promise chain. This same statement is true for setCertificatePromise. qz.security.setCertificatePromise((resolve, reject) => { reject("no"); }); Notice that the API calls do NOT reject. |
I understand that this leaves the state of a print job in limbo. Certificates are public, can be provided in clear text and should never fail, so this is less of a concern. Signatures are often handed off to a controller so a failure can be a sign of another issue with the backend system. I'll bring this up to our JS developer to see if there's a way to throw the rejection up the call stack. Pinging @akberenz. |
This is available starting now with the snapshot version: https://raw.githubusercontent.com/qzind/tray/master/js/qz-tray.js This will be released (e.g. to NPM) as qz-tray.js@2.2.4 in coordination with the future 2.2.4 release (probably sometime next week). |
Similar to issue #835, it is also difficult to recognise from the client's perspective when a signature request fails. It appears that data is still being sent via the web socket connection here without a traceable error/warning that could be handled in the client.
In our case, we would like to stop the printing process if the signature fails. Does anyone have any tips on how we can achieve this?
The text was updated successfully, but these errors were encountered: