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

Invalidate queries when the user goes online + Fix offline mode #11944

Merged
merged 10 commits into from
Jan 14, 2025

Conversation

MrFlashAccount
Copy link
Contributor

@MrFlashAccount MrFlashAccount commented Dec 27, 2024

Pull Request Description

Closes: https://github.com/enso-org/cloud-v2/issues/1630

  1. Invalidate remote backend queries when user goes online
  2. Moves auth-related logic from AuthProvider to SessionProvider
  3. Do not log user out if users/me returns 401

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@MrFlashAccount MrFlashAccount self-assigned this Dec 27, 2024
@MrFlashAccount MrFlashAccount added the CI: No changelog needed Do not require a changelog entry for this PR. label Dec 27, 2024
Copy link

github-actions bot commented Dec 27, 2024

🧪 Storybook is successfully deployed!

📊 Dashboard:

@MrFlashAccount MrFlashAccount marked this pull request as ready for review December 30, 2024 14:02
@MrFlashAccount MrFlashAccount changed the title Small adjustments Invalidate queries when user goes online + Fix offline mode Dec 30, 2024
@MrFlashAccount MrFlashAccount changed the title Invalidate queries when user goes online + Fix offline mode Invalidate queries when user go online + Fix offline mode Dec 30, 2024
@MrFlashAccount MrFlashAccount changed the title Invalidate queries when user go online + Fix offline mode Invalidate queries when the user goes online + Fix offline mode Dec 30, 2024
@PabloBuchu
Copy link
Contributor

Something is wrong with logging auth.. it is especially visible when I switch builds between environments. I was even able to lock myself out from the account (google sign in didnt work, even after cleaning all local storages)

Screen.Recording.2025-01-06.at.13.58.48.mp4

@MrFlashAccount
Copy link
Contributor Author

@PabloBuchu The invariant should be addressed in #11988

I think that switching between envs might trigger unexpected behavior as we don't nuke the persister storage when env change. This shouldn't be an issue for the end users though. Created an issue: https://github.com/enso-org/cloud-v2/issues/1665

*
* Currently used in unit tests to mock the Auth Provider API
*/
export interface ISessionProvider {
Copy link
Contributor

Choose a reason for hiding this comment

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

we typically don't do IInterfaceName in TS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, worth noting that we use interface as much as possible. And in most of the cases we don't need the I prefix, but for these interfaces, that supposed to be as implementation for classes, I think this might make sense, WDYT?

Copy link
Contributor

@somebody1234 somebody1234 left a comment

Choose a reason for hiding this comment

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

CR ✅

# Conflicts:
#	app/gui/src/dashboard/App.tsx
#	app/gui/src/dashboard/providers/__test__/SessionProvider.test.tsx
@MrFlashAccount MrFlashAccount added the CI: Ready to merge This PR is eligible for automatic merge label Jan 14, 2025
@mergify mergify bot merged commit 303888e into develop Jan 14, 2025
40 of 42 checks passed
@mergify mergify bot deleted the wip/sergeigarin/small-adjustments branch January 14, 2025 14:50
MrFlashAccount added a commit that referenced this pull request Jan 15, 2025
Closes: enso-org/cloud-v2#1630

1. Invalidate remote backend queries when user goes online
2. Moves auth-related logic from `AuthProvider` to `SessionProvider`
3. Do not log user out if `users/me` returns 401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants