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 persisting datasource selection choice #6181

Merged
merged 2 commits into from
Jul 15, 2023

Conversation

wlach
Copy link
Contributor

@wlach wlach commented Jul 15, 2023

Closes #5646.

We were already storing this in localStorage, however we weren't accounting for the fact that it was stored as a string, rather than an integer.

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

We were already storing this in localStorage, however we weren't accounting for the fact that it was stored as a string, rather than an integer.

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Ran redash locally, verified this fixes the issue.

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Closes #5646.

We were already storing this in localStorage, however we weren't
accounting for the fact that it was stored as a string, rather than
an integer.
@guidopetri
Copy link
Contributor

LGTM though I'm not a JS expert. Should we merge in the restyled changes?

@justinclift
Copy link
Member

Yep, we should merge in the restyled change. 😄

Co-authored-by: Restyled.io <commits@restyled.io>
@justinclift
Copy link
Member

Just pressed the button on that restyled change, so lets see how it all goes now. 😄

@codecov
Copy link

codecov bot commented Jul 15, 2023

Codecov Report

Merging #6181 (02ec0e4) into master (05526b5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #6181   +/-   ##
=======================================
  Coverage   59.71%   59.71%           
=======================================
  Files         151      151           
  Lines       12261    12261           
  Branches     1658     1658           
=======================================
  Hits         7322     7322           
  Misses       4733     4733           
  Partials      206      206           

@justinclift
Copy link
Member

Interesting. Looks like it's failed the same Cypress test twice. That could be just bad luck on a flaky test, but it might also mean there's something that needs a closer look.

Lets run the CI tests a third time, and see what happens...

@wlach
Copy link
Contributor Author

wlach commented Jul 15, 2023

Interesting. Looks like it's failed the same Cypress test twice. That could be just bad luck on a flaky test, but it might also mean there's something that needs a closer look.

Lets run the CI tests a third time, and see what happens...

Pretty skeptical this PR has any issues, it definitely passed on redashcommunity when I originally filed it.

@guidopetri
Copy link
Contributor

Flaky test indeed... merging while we can lol

@guidopetri guidopetri merged commit d5b821e into master Jul 15, 2023
@guidopetri guidopetri deleted the fix-persisting-datasource-selection-choice branch July 15, 2023 17:56
@justinclift
Copy link
Member

Awesome. 😄

We might need to look into that flaky test if it keeps on causing issues.

EmilaineBorato pushed a commit to sondautilities/sonda_d4b_redash that referenced this pull request Jul 24, 2023
* Fix persisting datasource selection choice

Closes getredash#5646.

We were already storing this in localStorage, however we weren't
accounting for the fact that it was stored as a string, rather than
an integer.

* Restyled by prettier (getredash#6182)

Co-authored-by: Restyled.io <commits@restyled.io>

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
harveyrendell pushed a commit to pushpay/redash that referenced this pull request Jan 8, 2025
* Fix persisting datasource selection choice

Closes getredash#5646.

We were already storing this in localStorage, however we weren't
accounting for the fact that it was stored as a string, rather than
an integer.

* Restyled by prettier (getredash#6182)

Co-authored-by: Restyled.io <commits@restyled.io>

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lastSelectedDataSourceId always reverts to alphabetically first data source
3 participants