AzBuilder / terrakube

Open source IaC Automation and Collaboration Software.
https://docs.terrakube.io
Apache License 2.0
496 stars 38 forks source link

Move ORGANIZATION_ARCHIVE, WORKSPACE_ARCHIVE, and ORGANIZATION_NAME from Local Storage to Session Storage to Prevent Workspace Conflicts Across Tabs #1266

Closed ilkerispir closed 3 weeks ago

ilkerispir commented 3 weeks ago

Bug description 🐞

Hello @alfespa17, @jcanizalez

Currently, ORGANIZATION_ARCHIVE, WORKSPACE_ARCHIVE, and ORGANIZATION_NAME are stored in Local Storage, which is shared across all browser tabs. This leads to a critical issue where, if a user opens multiple tabs and switches to a different workspace in one tab, the information in the other tabs is also updated to reflect the new workspace.

This results in unintended behavior, such as when a user triggers a Terraform plan from a tab associated with an old workspace, the plan instead gets executed for the new workspace due to the shared Local Storage.

Proposed Solution:

To fix this bug, we should move ORGANIZATION_ARCHIVE, WORKSPACE_ARCHIVE, and ORGANIZATION_NAME to Session Storage. This way, each tab will have its own separate set of data, corresponding to the workspace it is actively working on. This will prevent cross-tab interference and ensure that each tab functions independently within its own context.

Steps to reproduce

-

Expected behavior

-

Example repository

-

Anything else?

-

ilkerispir commented 3 weeks ago

Hello @alfespa17, @jcanizalez,

I've created a PR for this issue related to https://github.com/AzBuilder/terrakube/pull/1267

ilkerispir commented 3 weeks ago

@alfespa17, thank you for merging the PR, and could you please deploy a new beta release? I will test it in my environment.

alfespa17 commented 3 weeks ago

@alfespa17, thank you for merging the PR, and could you please deploy a new beta release? I will test it in my environment.

You can check this in your test environment.

2.23.0-beta.2