Thread: JavaScript Errors in the Query Tool Leads to a False Message
Hi Hackers,
I have noticed a strange behavior in the JS code of the Query Tool. When a JS error occurs at any point during the execution of a query, the code is traced back to the last ajax call and goes to the catch portion (as if the ajax call failed). This leads to a "Not connected to the server" error message to the user, which is wrong.
I noticed this behavior before when fixing the bug where "Not connected to the server" message appeared when the user queries a column with no columns, which was due to a JS error being mistakenly identified as an ajax error.
Does anybody have any idea why this happens? This doesn't seem right.
Thanks.
Yosry Muhammad Yosry
Computer Engineering student,
The Faculty of Engineering,
Cairo University (2021).
Class representative of CMP 2021.
Is there a way to reproduce this? i.e force a js error during query execution? One reason I can think of is using $.ajax({ async: false }) so the ajax request gets handled on the main thread and anything that throws on to the main thread gets caught.
On Tue, Aug 6, 2019 at 4:07 AM Yosry Muhammad <yosrym93@gmail.com> wrote:
Hi Hackers,I have noticed a strange behavior in the JS code of the Query Tool. When a JS error occurs at any point during the execution of a query, the code is traced back to the last ajax call and goes to the catch portion (as if the ajax call failed). This leads to a "Not connected to the server" error message to the user, which is wrong.I noticed this behavior before when fixing the bug where "Not connected to the server" message appeared when the user queries a column with no columns, which was due to a JS error being mistakenly identified as an ajax error.Does anybody have any idea why this happens? This doesn't seem right.Thanks.Yosry Muhammad YosryComputer Engineering student,The Faculty of Engineering,Cairo University (2021).Class representative of CMP 2021.
Hi Yosry,
Yes, I have experienced the same but missed to log a bug. You can log a bug so that someone can work on it.
To simulate the issue, just add some JS code that will cause error.
On Tue, Aug 6, 2019 at 10:06 AM Avin Kavish <avinkavish@gmail.com> wrote:
Is there a way to reproduce this? i.e force a js error during query execution? One reason I can think of is using $.ajax({ async: false }) so the ajax request gets handled on the main thread and anything that throws on to the main thread gets caught.On Tue, Aug 6, 2019 at 4:07 AM Yosry Muhammad <yosrym93@gmail.com> wrote:Hi Hackers,I have noticed a strange behavior in the JS code of the Query Tool. When a JS error occurs at any point during the execution of a query, the code is traced back to the last ajax call and goes to the catch portion (as if the ajax call failed). This leads to a "Not connected to the server" error message to the user, which is wrong.I noticed this behavior before when fixing the bug where "Not connected to the server" message appeared when the user queries a column with no columns, which was due to a JS error being mistakenly identified as an ajax error.Does anybody have any idea why this happens? This doesn't seem right.Thanks.Yosry Muhammad YosryComputer Engineering student,The Faculty of Engineering,Cairo University (2021).Class representative of CMP 2021.
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
Yes, if you undo this commit:
Your explanation seems legit to me but I am no expert in JS.
This was a fix of a bug that occurred when querying a table with no columns. It displayed the same error mentioned in the original email and was due to a JS error.
You can either checkout a previous commit or simply undo the difference in sqleditor.js manually, it is only 2 lines of code. Then try querying a table with no columns.
On Tue, Aug 6, 2019, 6:36 AM Avin Kavish <avinkavish@gmail.com> wrote:
Is there a way to reproduce this? i.e force a js error during query execution? One reason I can think of is using $.ajax({ async: false }) so the ajax request gets handled on the main thread and anything that throws on to the main thread gets caught.On Tue, Aug 6, 2019 at 4:07 AM Yosry Muhammad <yosrym93@gmail.com> wrote:Hi Hackers,I have noticed a strange behavior in the JS code of the Query Tool. When a JS error occurs at any point during the execution of a query, the code is traced back to the last ajax call and goes to the catch portion (as if the ajax call failed). This leads to a "Not connected to the server" error message to the user, which is wrong.I noticed this behavior before when fixing the bug where "Not connected to the server" message appeared when the user queries a column with no columns, which was due to a JS error being mistakenly identified as an ajax error.Does anybody have any idea why this happens? This doesn't seem right.Thanks.Yosry Muhammad YosryComputer Engineering student,The Faculty of Engineering,Cairo University (2021).Class representative of CMP 2021.
On Tue, Aug 6, 2019, 6:42 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Yosry,Yes, I have experienced the same but missed to log a bug. You can log a bug so that someone can work on it.To simulate the issue, just add some JS code that will cause error.
Will do.