public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager v2] ui: properly reset API 401 count
@ 2025-10-29 13:12 Dominik Csapak
  2025-10-29 13:14 ` Dominik Csapak
  2025-10-29 13:34 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2025-10-29 13:12 UTC (permalink / raw)
  To: pve-devel

due to a timing race condition, it can happen that we try to increase
the 401 count before resetting it (which happens after the first
ticket api call). Since `undefined + ` === NaN, our later check for
`> 5` never triggers and we don't show the login mask, but an empty
window.

To fix this, initialize the variable always with 0.

Observed when restoring a session after a ticket expired while the
browser was closed.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
changes from v1:
* rebase on master

 www/manager6/Workspace.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
index a2574658..60c499cb 100644
--- a/www/manager6/Workspace.js
+++ b/www/manager6/Workspace.js
@@ -13,6 +13,8 @@ Ext.define('PVE.Workspace', {
 
     loginData: null, // Data from last login call
 
+    response401count: 0,
+
     onLogin: function (loginData) {
         // override me
     },
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH manager v2] ui: properly reset API 401 count
  2025-10-29 13:12 [pve-devel] [PATCH manager v2] ui: properly reset API 401 count Dominik Csapak
@ 2025-10-29 13:14 ` Dominik Csapak
  2025-10-29 13:34 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2025-10-29 13:14 UTC (permalink / raw)
  To: pve-devel

i forgot to add Fionas R-b trailer... sorry!
just holler if i should send a v3 for that...

On 10/29/25 2:13 PM, Dominik Csapak wrote:
> due to a timing race condition, it can happen that we try to increase
> the 401 count before resetting it (which happens after the first
> ticket api call). Since `undefined + ` === NaN, our later check for
> `> 5` never triggers and we don't show the login mask, but an empty
> window.
> 
> To fix this, initialize the variable always with 0.
> 
> Observed when restoring a session after a ticket expired while the
> browser was closed.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> changes from v1:
> * rebase on master
> 
>   www/manager6/Workspace.js | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/www/manager6/Workspace.js b/www/manager6/Workspace.js
> index a2574658..60c499cb 100644
> --- a/www/manager6/Workspace.js
> +++ b/www/manager6/Workspace.js
> @@ -13,6 +13,8 @@ Ext.define('PVE.Workspace', {
>   
>       loginData: null, // Data from last login call
>   
> +    response401count: 0,
> +
>       onLogin: function (loginData) {
>           // override me
>       },



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied: [PATCH manager v2] ui: properly reset API 401 count
  2025-10-29 13:12 [pve-devel] [PATCH manager v2] ui: properly reset API 401 count Dominik Csapak
  2025-10-29 13:14 ` Dominik Csapak
@ 2025-10-29 13:34 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2025-10-29 13:34 UTC (permalink / raw)
  To: pve-devel, Dominik Csapak

On Wed, 29 Oct 2025 14:12:40 +0100, Dominik Csapak wrote:
> due to a timing race condition, it can happen that we try to increase
> the 401 count before resetting it (which happens after the first
> ticket api call). Since `undefined + ` === NaN, our later check for
> `> 5` never triggers and we don't show the login mask, but an empty
> window.
> 
> To fix this, initialize the variable always with 0.
> 
> [...]

Applied with Fiona's R-b, thanks!

[1/1] ui: properly reset API 401 count
      commit: 566412124a846f42420e013e5191224d4bd88c61


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-29 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-29 13:12 [pve-devel] [PATCH manager v2] ui: properly reset API 401 count Dominik Csapak
2025-10-29 13:14 ` Dominik Csapak
2025-10-29 13:34 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal