Bug #9260
The signature widget does not work if the web client is hidden by the proxy server.
100%
History
#2 Updated by Sergey Ivanovskiy almost 2 years ago
I got regressions in the signature widget:
58: 1729072026947 : MSG_GET_TEXT_WIDTH of length 199 done in 3 p2j.socket.js:4863:18
type=com.goldencode.p2j.ui.client.gui.driver.web.SignatureDriverWidget 12 p2j.screen.js:5565:15
59: 1729072027173 : MSG_CREATE_WIDGET of length 137 done in 7 p2j.socket.js:4863:18
setWidgetAttribute for 12 URL = /signature/12 p2j.screen.js:5507:15
60: 1729072027202 : MSG_SET_WIDGET_ATTRIBUTE of length 49 done in 3 p2j.socket.js:4863:18
GET
https://192.168.1.37:7449/signature/12
[HTTP/1.1 302 Found 2ms]
GET
https://192.168.1.37:7449/signature/12/
[HTTP/1.1 200 OK 6ms]
The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it. 12
GET
https://192.168.1.37:7449/signature/12/library/SigWebTablet.js
[HTTP/1.1 200 OK 3ms]
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help http://xhr.spec.whatwg.org/ SigWebTablet.js:23:6
XHRGET
https://tablet.sigwebtablet.com:47290/SigWeb/TabletState?noCache=91a44585-7e20-47a2-a596-f92b76c16fc6
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://tablet.sigwebtablet.com:47290/SigWeb/TabletState?noCache=91a44585-7e20-47a2-a596-f92b76c16fc6. (Reason: CORS request did not succeed). Status code: (null).
Unknown Error Occured. SigWeb Service response not received. SigWebTablet.js:19:13
catch DOMException: A network error occurred.
IsSigWebInstalled https://192.168.1.37:7449/signature/12/library/SigWebTablet.js:24
onload https://192.168.1.37:7449/signature/12/:39
EventHandlerNonNull* https://192.168.1.37:7449/signature/12/:30
SigWebTablet.js:26:11
unable to set widget attribute for 12 URL = /signature/12 p2j.screen.js:5520:18
send: -48 false p2j.socket.js:2615:15
Uncaught (in promise) ReferenceError: wid is not defined
ret https://192.168.1.37:7449/client/p2j.screen.js:1733
promise callback*setWidgetAttribute https://192.168.1.37:7449/client/p2j.screen.js:1732
setWidgetAttribute https://192.168.1.37:7449/client/p2j.screen.js:5509
messageHandler https://192.168.1.37:7449/common/p2j.socket.js:4607
handleMessageEvent https://192.168.1.37:7449/common/p2j.socket.js:5213
p2j.screen.js:1733:22
61: 1729072028021 : MSG_PLACE_WIDGET of length 25 done in 0 p2j.socket.js:4863:18
62: 1729072028060 : MSG_WINDOW_VISIBILITY of length 6 done in 2 p2j.socket.js:4863:18
63: 1729072028064 : MSG_MOVE_TO_TOP of length 6 done in 0 p2j.socket.js:4863:18
64: 1729072028246 : MSG_MOVE_TO_TOP of length 6 done in 1 p2j.socket.js:4863:18
65: 1729072028248 : MSG_MOVE_TO_TOP of length 6 done in 1 p2j.socket.js:4863:18
66: 1729072028287 : MSG_GET_TEXT_WIDTH of length 199 done in 3 p2j.socket.js:4863:18
Added driver widget 12 to window 1 p2j.screen.js:2073:15
67: 1729072028325 : MSG_PLACE_WIDGET of length 25 done in 1 p2j.socket.js:4863:18
68: 1729072028327 : MSG_SET_WIDGET_SENSITIVITY of length 6 done in 0 p2j.socket.js:4863:18
69: 1729072028371 : MSG_PLACE_WIDGET of length 25 done in 1 p2j.socket.js:4863:18
70: 1729072028372 : MSG_SET_WIDGET_VISIBILITY of length 6 done in 0 p2j.socket.js:4863:18
71: 1729072028418 : PROCESS_INTERACTIVE_WIDGETS of length 361 done in 3 p2j.socket.js:4863:18
72: 1729072028621 : MSG_REGISTER_HOVERABLE_WIDGET of length 100 done in 1 p2j.socket.js:4863:18
73: 1729072028622 : 4 draw: 14024 done in 17 p2j.socket.js:3072:24
We need to set the corresponding
access-control-allow-origin: header for the response related to the signature widget in order to enable https://tablet.sigwebtablet.com:47290 that is the local driver path. This header was set at some moment but now it was not.The second regression is this
Uncaught (in promise) ReferenceError: wid is not defined.Planning to fix these regressions within
9170b because it was created after #9170 was reopened.#3 Updated by Sergey Ivanovskiy almost 2 years ago
This documentation https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS describes ways to say what cross origin requests are permitted to the browser but we have the main page that creates an iframe element for the signature widget first and then the second request (comes from the iframe) retrieves the p2j.signature.html page so iframe loads this page. When this page has been loaded, it makes a cross origin request to https://tablet.sigwebtablet.com:47290. Thus I confused where we should permit cross origin requests for the main page with the corresponding responses to the browser or it is enough to respond correctly to the iframe GET request for p2j.signature.html page. I tried to respond correctly according to the CORS specification to the browser in the second request but did not succeed. Should we move back CORS for the main web client page? Hynek, what do you think? What I missed?
#4 Updated by Hynek Cihlar almost 2 years ago
According to the log output, the server at https://tablet.sigwebtablet.com:47290 needs to return appropriate CORS headers to allow the cross-origin request from https://192.168.1.37:7449.
#5 Updated by Sergey Ivanovskiy almost 2 years ago
Hynek Cihlar wrote:
According to the log output, the server at https://tablet.sigwebtablet.com:47290 needs to return appropriate CORS headers to allow the cross-origin request from https://192.168.1.37:7449.
Thanks, I was confused that the driver server should send this access-control-allow-origin header with the response on this GET request. In my case the driver server was not installed on this system. I interpreted this request as blocked but actually the browser should send OPTIONS request before GET request although I did not see OPTIONS request. Can this request be hidden?
#6 Updated by Hynek Cihlar almost 2 years ago
Sergey Ivanovskiy wrote:
Hynek Cihlar wrote:
According to the log output, the server at https://tablet.sigwebtablet.com:47290 needs to return appropriate CORS headers to allow the cross-origin request from https://192.168.1.37:7449.
Thanks, I was confused that the driver server should send this
access-control-allow-originheader with the response on this GET request. In my case the driver server was not installed on this system. I interpreted this request as blocked but actually the browser should send OPTIONS request before GET request although I did not see OPTIONS request. Can this request be hidden?
The preflight request (OPTIONS) is only sent for some kinds of requests. I.e. only for some request methods, when credentials are also sent, for some content-types, etc. But if it is sent I think you should see it in the Network dev output.
#7 Updated by Sergey Ivanovskiy almost 2 years ago
- % Done changed from 0 to 80
I committed changes for this task in rev 15497-15498 (9170b) and planning to test with the driver installed and with the proxy server.
#8 Updated by Sergey Ivanovskiy over 1 year ago
- Status changed from New to WIP
Found that /signature/test-signature-1.p was broken.
#9 Updated by Sergey Ivanovskiy over 1 year ago
Save signature testcase does not work.
#10 Updated by Greg Shah over 1 year ago
Is there more testing to be done?
What is the effort to fix this? I think this is urgent since it will affect a customer that is about to deploy, right?
#11 Updated by Sergey Ivanovskiy over 1 year ago
Yes, I think it should be fixed, I am working with rev 15737 (9170b). The currently I found that the testcase program could throw strange exception after a period of proper working flow
#12 Updated by Sergey Ivanovskiy over 1 year ago
Web socket throws 1001 code that means The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection. At this moment I do not understand the root causes.
Investigating also why the Save signature usecase does not work for this testcase.
#14 Updated by Sergey Ivanovskiy over 1 year ago
Actually the Save signature usecase works properly, sorry for false negative. The target signature file stored on the server side.
#15 Updated by Sergey Ivanovskiy over 1 year ago
I resolved this issue, the signature widget with the proxy server works as expected. I just need to check the code related to IFrameWidget inheritance logic and to fix the found unresolved references issue. So this task branch should be ready for commit today.
#16 Updated by Sergey Ivanovskiy over 1 year ago
- Status changed from WIP to Review
- % Done changed from 80 to 100
- reviewer Radu Apetrii added
Committed revision 15738 (9170b) fixed all found issues and is ready for the trunk. Please review.
#18 Updated by Radu Apetrii over 1 year ago
The changes in 9170b look good to me. However, I must admit that I'm not the best person to review them (my expertise in that area is quite thin), so I think we should also wait for Greg's opinion.
#19 Updated by Greg Shah over 1 year ago
- reviewer Hynek Cihlar added
- reviewer deleted (
Greg Shah, Radu Apetrii)
#20 Updated by Sergey Ivanovskiy over 1 year ago
- Priority changed from Normal to High
#21 Updated by Hynek Cihlar over 1 year ago
- Status changed from Review to Internal Test
Code review 9170b revision 15738. The changes look good to me.
#22 Updated by Sergey Ivanovskiy over 1 year ago
I tested this revision for 3 cases: the signature hardware driver is not installed, the environment with the Apache proxy server and with bare standard server. The changes impact only signature widget implementation. The changes can be merged into the trunk.
#23 Updated by Hynek Cihlar over 1 year ago
- Status changed from Internal Test to Merge Pending
Please merge 9170b to trunk.
#24 Updated by Sergey Ivanovskiy over 1 year ago
- Status changed from Merge Pending to Test
Branch 9170b was merged to trunk as rev.15740 and archived.