Re: SameSite issues in Safari Browser (reference #RM5975)

2020-12-02 Thread Dave Page
Hi

On Tue, Dec 1, 2020 at 5:51 PM Rahul Shirsat 
wrote:

> Hi Dave,
>
> Could you please add below FAQ point for SameSite Safari issue:
>
> Question :
> When I set new tab settings for query tool or schema-diff, I get
> "Connection to server lost" or "CSRF tokens do not match" on Safari
> versions >= 12
>
> Answer:
> This has been seen mostly on Safari browser versions >= 12. It's
> reported that from v12 of CFNetwork/Safari/Webkit erroneously handle
> "Samesite=none" as the equivalent of "Samesite=strict". It means, Safari
> recognizes the SameSite option starting with version 12, but their
> implementation has a bug: It interprets invalid values as if
> SameSite=Strict had been specified, and for it only Strict and Lax are
> valid values, as the older specification did not yet specify None
>
> To solve this issue, we need to override the SameSite security
> settings, for this, create a file called config_system.py in the web/
> directory of the installation, alongside the existing config.py. This file
> can be used to override any of the settings in config.py (which shouldn't
> be edited). The config_system.py should have the below code:
>

We could certainly add something like that, though, config_system.py
doesn't go alongside config.py so that part of the text needs fixing.


>
> 
> import sys
>
> # Targeting only macOS
> if sys.platform.startswith('darwin'):
> SESSION_COOKIE_SAMESITE = None
> SESSION_COOKIE_SECURE = True
> 
>
> Do suggest or add any points if I am missing them.
>

And that is not going to work in Server mode, only Desktop.



>
> Also, let me know once this is done, So that I will close the ticket.
>
> --
> *Rahul Shirsat*
> Senior Software Engineer | EnterpriseDB Corporation.
>
> On Mon, Nov 30, 2020 at 7:30 PM Rahul Shirsat <
> rahul.shir...@enterprisedb.com> wrote:
>
>> This was the part of our internal quality testing, where it got
>> encountered. Currently, none of the users have complained about this on
>> their specific browser versions.
>>
>> On Mon, Nov 30, 2020 at 5:12 PM Dave Page  wrote:
>>
>>> Hi
>>>
>>> On Mon, Nov 30, 2020 at 7:12 AM Rahul Shirsat <
>>> rahul.shir...@enterprisedb.com> wrote:
>>>
 Dave,

 There are issues discussed on Apple forums, check this out:

 https://developer.apple.com/forums/thread/129064 - The latest comment
 by the user here is one month ago, meaning the issue is still not fixed 
 yet.
 https://developer.apple.com/forums/thread/658688 - Users facing this
 issue in v13.x

 Even webkit has confirmed about this issue :
 https://bugs.webkit.org/show_bug.cgi?id=198181 - Users facing this
 issue in v12.x

>>>
>>> In that case, I think the answer (for now at least) is an FAQ,
>>> referencing those issues and explaining how to resolve the issue using
>>> config_system.py or by using a different browser.
>>>
>>> Have we actually seen this issue in wild?
>>>
>>>
>>>

 On Thu, Nov 26, 2020 at 6:57 PM Dave Page  wrote:

> Hi
>
> On Wed, Nov 25, 2020 at 10:37 AM Rahul Shirsat <
> rahul.shir...@enterprisedb.com> wrote:
>
>> Hi Dave,
>>
>> Due to SameSite security issues in Safari Browser, some of the
>> pgadmin4 functionality isn't working (mostly the new tab functionality).
>>
>> The affected Safari Browser versions (marked in red) currently tested
>> upon are:
>>
>>1. v11.1.2
>>2. v12.1
>>3. v12.1.1
>>4. 13.1
>>5. 14.0.1
>>
>> Since v12, Safari have done some security fixes, due to which this
>> issue has occurred. Strangely, the issue is not reproducible on v13, but
>> reproducible on its successor i.e. v14
>>
>> Possible solutions could be:
>>
>>1. Reporting this to Safari & raising an RM for tracking purposes.
>>2. Suggesting Safari users to make below changes in config.py or
>>config_distro for the work around:
>>
>> *SESSION_COOKIE_SAMESITE = None*
>>
>> *SESSION_COOKIE_SECURE = True*
>> (As we aren't going through any cross-site cookie transfer, this can
>> be a handy option - but still risky..)
>>
>> I would suggest going with the 1st option or combination of both, but
>> with caution.
>>
>
> Others must have come across this issue already. Is it a known bug,
> documented somewhere (ideally on apple.com)?
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EDB: http://www.enterprisedb.com
>
>

 --
 *Rahul Shirsat*
 Software Engineer | EnterpriseDB Corporation.

>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EDB: http://www.enterprisedb.com
>>>
>>>
>>
>> --
>> *Rahul Shirsat*
>> Software Engineer | EnterpriseDB Corporation.
>>
>
>
> --
> *Rahul Shirsat*
> Software Engineer | EnterpriseDB Corporation.
>


-- 
Dave Page
Blog: http://pgsnake.blogspot.co

[pgAdmin][RM-6022]: Shared servers import is failing.

2020-12-02 Thread Nikhil Mohite
Hi Team,

Please find the patch for RM-6022
: Shared servers import is
failing.
added missing shared server flag while loading servers.

-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* 
*Mob.No: +91-7798364578.*


RM_6022.patch
Description: Binary data


[pgAdmin][RM-5982]: Minor Documentation Issue: Example JSON not valid in current docs.

2020-12-02 Thread Nikhil Mohite
Hi Team,

Please find the patch for RM-5982
:
Minor
Documentation Issue: Example JSON not valid in current docs.

-- 
*Thanks & Regards,*
*Nikhil Mohite*
*Software Engineer.*
*EDB Postgres* 
*Mob.No: +91-7798364578.*


RM_5982.patch
Description: Binary data


pgAdmin 4 commit: Improve code coverage and API test cases for Debugger

2020-12-02 Thread Akshay Joshi
Improve code coverage and API test cases for Debugger. Fixes #5343

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=794bd50ed107254b87404e70c665fac6f9231f79
Author: Nikhil Mohite 

Modified Files
--
docs/en_US/release_notes_4_29.rst  |1 +
.../databases/schemas/functions/tests/utils.py |7 +-
.../schemas/tables/triggers/tests/utils.py |2 +-
web/pgadmin/tools/debugger/__init__.py |  117 +-
web/pgadmin/tools/debugger/static/js/debugger.js   |8 +-
.../tools/debugger/static/js/debugger_ui.js|4 +-
web/pgadmin/tools/debugger/tests/__init__.py   |0
.../tools/debugger/tests/debugger_test_data.json   | 1703 
.../tools/debugger/tests/test_close_debugger.py|   77 +
.../tests/test_debugger_clear_all_breakpoint.py|   92 ++
.../tests/test_debugger_clear_arguments.py |   83 +
.../tools/debugger/tests/test_debugger_direct.py   |   84 +
.../debugger/tests/test_debugger_execute_query.py  |   86 +
.../debugger/tests/test_debugger_get_arguments.py  |   71 +
.../tests/test_debugger_poll_execution_result.py   |   86 +
.../debugger/tests/test_debugger_poll_result.py|   83 +
.../debugger/tests/test_debugger_set_arguments.py  |   89 +
.../debugger/tests/test_debugger_set_breakpoint.py |   89 +
.../debugger/tests/test_init_debugger_function.py  |  113 ++
.../debugger/tests/test_init_debugger_trigger.py   |   95 ++
.../tools/debugger/tests/test_init_target.py   |  137 ++
.../tools/debugger/tests/test_messages_debugger.py |   80 +
.../tools/debugger/tests/test_restart_debugger.py  |   82 +
.../tests/test_start_execution_debugger.py |   85 +
.../debugger/tests/test_start_listener_debugger.py |   89 +
web/pgadmin/tools/debugger/tests/utils.py  |  146 ++
26 files changed, 3436 insertions(+), 73 deletions(-)



pgAdmin 4 commit: Fixed an issue where shared servers import is failing

2020-12-02 Thread Akshay Joshi
Fixed an issue where shared servers import is failing. Fixes #6022

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=1c5cb63affc20cb87bed2e86bca0f275df3856f2
Author: Nikhil Mohite 

Modified Files
--
docs/en_US/release_notes_4_29.rst | 1 +
web/setup.py  | 3 +++
2 files changed, 4 insertions(+)



pgAdmin 4 commit: Fixed documentation issue where JSON is not valid. Fi

2020-12-02 Thread Akshay Joshi
Fixed documentation issue where JSON is not valid. Fixes #5982

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=12dc2c418d51ee396833c55e5e4ded00fbd5246e
Author: Nikhil Mohite 

Modified Files
--
docs/en_US/import_export_servers.rst | 2 +-
docs/en_US/release_notes_4_29.rst| 1 +
2 files changed, 2 insertions(+), 1 deletion(-)



pgAdmin 4 commit: Fixed an issue where an illegal argument is showing f

2020-12-02 Thread Akshay Joshi
Fixed an issue where an illegal argument is showing for trigger SQL when a 
trigger is created for View. Fixes #6003

Branch
--
master

Details
---
https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=26b3bc3f748ec3bd9395a4acbf325c5cf6b60d19
Author: Yogesh Mahajan 

Modified Files
--
docs/en_US/release_notes_4_29.rst| 1 +
.../server_groups/servers/databases/schemas/views/__init__.py| 9 ++---
2 files changed, 7 insertions(+), 3 deletions(-)



Re: [pgAdmin][Patch] Bug #6003 - exibição errada de tabela em trigger de view (Wrong table display in view trigger)

2020-12-02 Thread Akshay Joshi
Thanks, patch applied.

On Tue, Dec 1, 2020 at 9:13 PM Yogesh Mahajan <
yogesh.maha...@enterprisedb.com> wrote:

> Hi,
>
> Please find a patch which fixes incorrect view trigger sql display for
> table sql.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM-5343]: [Code Coverage] Improve API test cases for Debugger

2020-12-02 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Dec 2, 2020 at 11:25 AM Nikhil Mohite <
nikhil.moh...@enterprisedb.com> wrote:

> Hi Akshay,
>
> please find the updated patch, sorry for the inconvenience.
>
>
> Regards,
> Nikhil Mohite.
>
> On Wed, Dec 2, 2020 at 11:03 AM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Hi Nikhil
>>
>> The patch is not applied, please rebase and send the patch again.
>>
>> On Tue, Dec 1, 2020 at 2:48 PM Nikhil Mohite <
>> nikhil.moh...@enterprisedb.com> wrote:
>>
>>> Hi Team,
>>>
>>> Please find the attached patch for RM-5343
>>> : [Code Coverage] Improve
>>> API test cases for Debugger.
>>> also updated implementation to remove dead code and unhandled exceptions.
>>>
>>>
>>> --
>>> *Thanks & Regards,*
>>> *Nikhil Mohite*
>>> *Software Engineer.*
>>> *EDB Postgres* 
>>> *Mob.No: +91-7798364578.*
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres *
>>
>> *Mobile: +91 976-788-8246*
>>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM-6022]: Shared servers import is failing.

2020-12-02 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Dec 2, 2020 at 5:23 PM Nikhil Mohite 
wrote:

> Hi Team,
>
> Please find the patch for RM-6022
> : Shared servers import is
> failing.
> added missing shared server flag while loading servers.
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Software Engineer.*
> *EDB Postgres* 
> *Mob.No: +91-7798364578.*
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: [pgAdmin][RM-5982]: Minor Documentation Issue: Example JSON not valid in current docs.

2020-12-02 Thread Akshay Joshi
Thanks, patch applied.

On Wed, Dec 2, 2020 at 5:51 PM Nikhil Mohite 
wrote:

> Hi Team,
>
> Please find the patch for RM-5982
> :
>  Minor
> Documentation Issue: Example JSON not valid in current docs.
>
> --
> *Thanks & Regards,*
> *Nikhil Mohite*
> *Software Engineer.*
> *EDB Postgres* 
> *Mob.No: +91-7798364578.*
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres *

*Mobile: +91 976-788-8246*


Re: pgAdmin 4 commit: Fixed an issue where the validation error message is

2020-12-02 Thread Murtuza Zabuawala
Hello,

What is the reason for adding delay *setTimeout(, 120)*?

This is causing issues in automation testing and makes buttons
enable/disable with slight delay.

--
Regards,
Murtuza Zabuawala
*EDB*
*POWER TO POSTGRES*
https://www.edbpostgres.com


On Fri, Oct 30, 2020 at 3:10 PM Akshay Joshi 
wrote:

> Fixed an issue where the validation error message is shown twice. Fixes
> #5736
>
> Branch
> --
> master
>
> Details
> ---
>
> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=183c83f0d2b2cb8dd33f9e8c41a030bc4cdaa4b2
> Author: Rahul Shirsat 
>
> Modified Files
> --
> docs/en_US/release_notes_4_28.rst  |  1 +
> web/pgadmin/browser/static/js/datamodel.js | 75
> +-
> web/pgadmin/static/js/backform.pgadmin.js  | 24 --
> web/pgadmin/static/scss/_alert.scss|  6 +++
> 4 files changed, 90 insertions(+), 16 deletions(-)
>
>


Re: pgAdmin 4 commit: Fixed an issue where the validation error message is

2020-12-02 Thread Murtuza Zabuawala
Hello,

Another observation,

+if(msg && handler) {
+  msg = msg || _.values(handler.errorModel.attributes)[0];
+
+  handler.trigger('pgadmin-session:model:invalid', msg, handler);
+  $(parentTr).addClass('error-in-grid');
+}
+return this;
+  }, 120);
+},

Here we are only making the model invalid, there is no logic to make it
valid again.


On Thu, Dec 3, 2020 at 11:09 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hello,
>
> What is the reason for adding delay *setTimeout(, 120)*?
>
> This is causing issues in automation testing and makes buttons
> enable/disable with slight delay.
>
> --
> Regards,
> Murtuza Zabuawala
> *EDB*
> *POWER TO POSTGRES*
> https://www.edbpostgres.com
>
>
> On Fri, Oct 30, 2020 at 3:10 PM Akshay Joshi <
> akshay.jo...@enterprisedb.com> wrote:
>
>> Fixed an issue where the validation error message is shown twice. Fixes
>> #5736
>>
>> Branch
>> --
>> master
>>
>> Details
>> ---
>>
>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=183c83f0d2b2cb8dd33f9e8c41a030bc4cdaa4b2
>> Author: Rahul Shirsat 
>>
>> Modified Files
>> --
>> docs/en_US/release_notes_4_28.rst  |  1 +
>> web/pgadmin/browser/static/js/datamodel.js | 75
>> +-
>> web/pgadmin/static/js/backform.pgadmin.js  | 24 --
>> web/pgadmin/static/scss/_alert.scss|  6 +++
>> 4 files changed, 90 insertions(+), 16 deletions(-)
>>
>>


Re: pgAdmin 4 commit: Fixed an issue where the validation error message is

2020-12-02 Thread Rahul Shirsat
On Thu, Dec 3, 2020 at 11:18 AM Murtuza Zabuawala <
murtuza.zabuaw...@enterprisedb.com> wrote:

> Hello,
>
> Another observation,
>
> +if(msg && handler) {
> +  msg = msg || _.values(handler.errorModel.attributes)[0];
> +
> +  handler.trigger('pgadmin-session:model:invalid', msg, handler);
> +  $(parentTr).addClass('error-in-grid');
> +}
> +return this;
> +  }, 120);
> +},
>
> Here we are only making the model invalid, there is no logic to make it
> valid again.
>

 If there are multiple model errors in the list, and if user changes any of
them, it used to clear every other invalid models in the list. To avoid
this to happen, only invalid models are highlighted, rest others are taken
care of by the child valid events running in parallel.

>
>
>
> On Thu, Dec 3, 2020 at 11:09 AM Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hello,
>>
>> What is the reason for adding delay *setTimeout(, 120)*?
>>
>> This is causing issues in automation testing and makes buttons
>> enable/disable with slight delay.
>>
>>  Timeout was added for the reason that, even if the current changed
model is valid, it should also check the rest of the invalid models in the
list. Slight delay was added, so even if the current model becomes valid,
it should highlight the invalid one iterating over the inner model list.

> --
>> Regards,
>> Murtuza Zabuawala
>> *EDB*
>> *POWER TO POSTGRES*
>> https://www.edbpostgres.com
>>
>>
>> On Fri, Oct 30, 2020 at 3:10 PM Akshay Joshi <
>> akshay.jo...@enterprisedb.com> wrote:
>>
>>> Fixed an issue where the validation error message is shown twice. Fixes
>>> #5736
>>>
>>> Branch
>>> --
>>> master
>>>
>>> Details
>>> ---
>>>
>>> https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=183c83f0d2b2cb8dd33f9e8c41a030bc4cdaa4b2
>>> Author: Rahul Shirsat 
>>>
>>> Modified Files
>>> --
>>> docs/en_US/release_notes_4_28.rst  |  1 +
>>> web/pgadmin/browser/static/js/datamodel.js | 75
>>> +-
>>> web/pgadmin/static/js/backform.pgadmin.js  | 24 --
>>> web/pgadmin/static/scss/_alert.scss|  6 +++
>>> 4 files changed, 90 insertions(+), 16 deletions(-)
>>>
>>>

-- 
*Rahul Shirsat*
Software Engineer | EnterpriseDB Corporation.


Re: pgAdmin 4 commit: Fixed an issue where the validation error message is

2020-12-02 Thread Murtuza Zabuawala
On Thu, Dec 3, 2020 at 12:29 PM Rahul Shirsat <
rahul.shir...@enterprisedb.com> wrote:

>
>
> On Thu, Dec 3, 2020 at 11:18 AM Murtuza Zabuawala <
> murtuza.zabuaw...@enterprisedb.com> wrote:
>
>> Hello,
>>
>> Another observation,
>>
>> +if(msg && handler) {
>> +  msg = msg || _.values(handler.errorModel.attributes)[0];
>> +
>> +  handler.trigger('pgadmin-session:model:invalid', msg, handler);
>> +  $(parentTr).addClass('error-in-grid');
>> +}
>> +return this;
>> +  }, 120);
>> +},
>>
>> Here we are only making the model invalid, there is no logic to make it
>> valid again.
>>
>
>  If there are multiple model errors in the list, and if user changes any
> of them, it used to clear every other invalid models in the list. To avoid
> this to happen, only invalid models are highlighted, rest others are taken
> care of by the child valid events running in parallel.
>

This is causing issues when we have a nested collection control (ie:
Subnode control under Subnode control), the error model is not getting
cleared in that case because we do not have logic to make it valid here in
settimeout, so the save button in the parent model is not getting enabled.

>
>>
>>
>> On Thu, Dec 3, 2020 at 11:09 AM Murtuza Zabuawala <
>> murtuza.zabuaw...@enterprisedb.com> wrote:
>>
>>> Hello,
>>>
>>> What is the reason for adding delay *setTimeout(, 120)*?
>>>
>>> This is causing issues in automation testing and makes buttons
>>> enable/disable with slight delay.
>>>
>>>  Timeout was added for the reason that, even if the current changed
> model is valid, it should also check the rest of the invalid models in the
> list. Slight delay was added, so even if the current model becomes valid,
> it should highlight the invalid one iterating over the inner model list.
>

This is causing issue in automation tests because it introduced delay in
the buttons enable/disable state in the parent collection.



> --
>>> Regards,
>>> Murtuza Zabuawala
>>> *EDB*
>>> *POWER TO POSTGRES*
>>> https://www.edbpostgres.com
>>>
>>>
>>> On Fri, Oct 30, 2020 at 3:10 PM Akshay Joshi <
>>> akshay.jo...@enterprisedb.com> wrote:
>>>
 Fixed an issue where the validation error message is shown twice. Fixes
 #5736

 Branch
 --
 master

 Details
 ---

 https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=183c83f0d2b2cb8dd33f9e8c41a030bc4cdaa4b2
 Author: Rahul Shirsat 

 Modified Files
 --
 docs/en_US/release_notes_4_28.rst  |  1 +
 web/pgadmin/browser/static/js/datamodel.js | 75
 +-
 web/pgadmin/static/js/backform.pgadmin.js  | 24 --
 web/pgadmin/static/scss/_alert.scss|  6 +++
 4 files changed, 90 insertions(+), 16 deletions(-)


>
> --
> *Rahul Shirsat*
> Software Engineer | EnterpriseDB Corporation.
>