qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
824 stars 266 forks source link

HTML Worker.State.CANCELLED throws TimeoutException #1183

Closed tresf closed 9 months ago

tresf commented 9 months ago

Steps:


var config = qz.configs.create("PDF");
var data = [{
   type: "pixel",
   format: "html",
   flavor: "file",
   data: "https://filebin.net/1jij1l087a0ts7pw/receipt.html"
}];

qz.print(config, data).catch(e => console.error(e));
tresf commented 9 months ago

In regards to the behavior of JavaFX and this particular URL, it's hard to find a cause. Using FINE logging from within WebView, I was able to obtain this error:

FINE: Error in fwkFireResourceLoadEvent: unknown request id 3

... but I'm not sure what this means, nor am I sure whether or not it's related to the behavior. To track the URL problem, I've filed upstream with Gluon SUPQZ-16 (private). I will link public the bug report if one gets created.

For now, I think the best we can do is prevent the lockup by supplying an error when Worker.State.CANCELLED is triggered.

tresf commented 9 months ago

So it turns out that the URL is adding response-content-disposition=attachment, which tries to perform a file download, which isn't currently implemented.

We'll gracefully handle the error, but detecting the specific response-content-disposition seems out of scope.

1184 will properly show the redirect now at least, which will potentially help identify this edge-case when reading the logs.