Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sqllab): don't store user in localstorage #14722

Merged
merged 2 commits into from
May 20, 2021

Conversation

suddjian
Copy link
Member

@suddjian suddjian commented May 19, 2021

SUMMARY

When the feature flag SQLLAB_BACKEND_PERSISTENCE is set to False, user data is currently saved in local storage. A recent change added roles information to the bootstrap user object. But with the flag off, local storage data ends up overwriting the bootstrap data, and the roles are lost, which breaks the page. This change removes user data from local storage, and prevents it from overwriting the bootstrap data.

TEST PLAN

  • Turn the flag off
  • checkout a commit from before a7a011cce5ea9a9ae6cebf40b6e5bc6257d7746d
  • visit sql lab, execute a query (loads your user into localstorage)
  • checkout this fix
  • visit sql lab (user is removed from localstorage and page should show up)

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@suddjian suddjian changed the title Fix user in localstorage fix(sqllab): don't store user in localstorage May 19, 2021
@junlincc junlincc added the need:qa-review Requires QA review label May 19, 2021
@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

Merging #14722 (9e9c8c8) into master (67e3730) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #14722   +/-   ##
=======================================
  Coverage   77.45%   77.45%           
=======================================
  Files         959      959           
  Lines       48660    48702   +42     
  Branches     5734     5740    +6     
=======================================
+ Hits        37688    37724   +36     
- Misses      10771    10777    +6     
  Partials      201      201           
Flag Coverage Δ
javascript 72.51% <0.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (ø)
...c/views/CRUD/data/database/DatabaseModal/styles.ts 97.46% <0.00%> (+1.46%) ⬆️
...c/views/CRUD/data/database/DatabaseModal/index.tsx 59.29% <0.00%> (+2.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67e3730...9e9c8c8. Read the comment docs.

@pkdotson
Copy link
Member

/testenv up

@suddjian
Copy link
Member Author

@pkdotson in this case I don't think a testenv will be able to fully verify the PR, see test plan

@github-actions
Copy link
Contributor

@pkdotson Ephemeral environment spinning up at http://34.222.39.207:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... I really need to push for deprecating local storage and have the backend persistence always on.

@suddjian suddjian merged commit 0e86a6b into apache:master May 20, 2021
@suddjian suddjian deleted the fix-user-in-localstorage branch May 20, 2021 23:36
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

serenajiang pushed a commit to airbnb/superset-fork that referenced this pull request May 21, 2021
* fix(sqllab): remove user info from localstorage

* filter out user data when loading localstorage
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* fix(sqllab): remove user info from localstorage

* filter out user data when loading localstorage
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix(sqllab): remove user info from localstorage

* filter out user data when loading localstorage
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* fix(sqllab): remove user info from localstorage

* filter out user data when loading localstorage
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels need:qa-review Requires QA review preset-io size/S 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants