Thread: [pgAdmin4][Patch#3389] To prevent unwanted model changes in Server dialog

[pgAdmin4][Patch#3389] To prevent unwanted model changes in Server dialog

From
Murtuza Zabuawala
Date:
Hi,

PFA minor patch to fix the issue when you change any field in server dialog 'tunnel_identity_file' model value get included unnecessarily in the update request.

eg: Change the server name and click on Save button, Check the request payload in network console.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

Re: [pgAdmin4][Patch#3389] To prevent unwanted model changes inServer dialog

From
Joao De Almeida Pereira
Date:

Hi Murtuza,

We are having a hard time understanding the logic on the change.

If tunnel_authentication is not on the model and the tunnel_identify_file is present, we change the tunnel_identify_file in the model to null? Is this what you mean?

Thanks
Victoria && Joao


On Wed, May 30, 2018 at 9:27 AM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

PFA minor patch to fix the issue when you change any field in server dialog 'tunnel_identity_file' model value get included unnecessarily in the update request.

eg: Change the server name and click on Save button, Check the request payload in network console.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgAdmin4][Patch#3389] To prevent unwanted model changes inServer dialog

From
Murtuza Zabuawala
Date:
Hello Victoria & Joao,


On Thu, May 31, 2018 at 2:17 AM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:

Hi Murtuza,

We are having a hard time understanding the logic on the change.

If tunnel_authentication is not on the model and the tunnel_identify_file is present, we change the tunnel_identify_file in the model to null? Is this what you mean?

​Yes, basically we make use of identity file only in case of tunnel authentication​ is enabled (true/false).

The earlier logic was written in such way that if tunnel authentication is set to disbaled/false then set the identity file filed value to empty string in the model, But as you can see that tunnel authentication is by default set to '0' in the model, so whenever user opens a edit/properties dialog the identitiy files sets to empty string even if ssh tunnel is disbaled. In my patch I choose to nullify the value instead of empty string so that it will be easy on python side condition checking :)


 

Thanks
Victoria && Joao


On Wed, May 30, 2018 at 9:27 AM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

PFA minor patch to fix the issue when you change any field in server dialog 'tunnel_identity_file' model value get included unnecessarily in the update request.

eg: Change the server name and click on Save button, Check the request payload in network console.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][Patch#3389] To prevent unwanted model changes inServer dialog

From
Victoria Henry
Date:
Hey Murtuza,

Thanks for the explanation.  That seems fine.  This patch can be submitted.

Sincerely,

Victoria & Anthony

On Thu, May 31, 2018 at 2:22 AM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hello Victoria & Joao,


On Thu, May 31, 2018 at 2:17 AM, Joao De Almeida Pereira <jdealmeidapereira@pivotal.io> wrote:

Hi Murtuza,

We are having a hard time understanding the logic on the change.

If tunnel_authentication is not on the model and the tunnel_identify_file is present, we change the tunnel_identify_file in the model to null? Is this what you mean?

​Yes, basically we make use of identity file only in case of tunnel authentication​ is enabled (true/false).

The earlier logic was written in such way that if tunnel authentication is set to disbaled/false then set the identity file filed value to empty string in the model, But as you can see that tunnel authentication is by default set to '0' in the model, so whenever user opens a edit/properties dialog the identitiy files sets to empty string even if ssh tunnel is disbaled. In my patch I choose to nullify the value instead of empty string so that it will be easy on python side condition checking :)


 

Thanks
Victoria && Joao


On Wed, May 30, 2018 at 9:27 AM Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

PFA minor patch to fix the issue when you change any field in server dialog 'tunnel_identity_file' model value get included unnecessarily in the update request.

eg: Change the server name and click on Save button, Check the request payload in network console.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Thanks, patch pushed.

On Wed, May 30, 2018 at 9:26 AM, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
Hi,

PFA minor patch to fix the issue when you change any field in server dialog 'tunnel_identity_file' model value get included unnecessarily in the update request.

eg: Change the server name and click on Save button, Check the request payload in network console.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company




--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company