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

Switch to FB session login, and record last launch time #2396

Merged
merged 9 commits into from
Sep 11, 2024

Conversation

scytacki
Copy link
Member

@scytacki scytacki commented Sep 4, 2024

By switching from a Firebase local login to a session login, each new tab/window will get its own Firebase login.

The reason for switching this is:

  • to eliminate the need for qaClear in our Cypress tests
  • be a part of fixing the problem we have with clearing Firestore qa data.
  • make our portal launches more consistent and secure. Currently if a user launches two assignments in two tabs they will share the same Firebase auth. I haven't tested this, but I'm pretty sure this results in several issues.

The last launch time is recorded so a background script can be scanning the roots and delete ones that haven't been used in a while. The firebase function for this background script will be in a separate PR.

This PR will make appMode=dev be much less "sticky" than it used to be. Each time a new browser tab is opened a new dev root in Firestore and the Realtime database will be created. A separate PR will improve this by storing the dev root in local storage so it is "sticky" again. In fact this new approach should be more sticky than it originally was.

The majority of the files changed are Cypress tests that no longer need to call clearQAData. Other Cypress changes:

  • The teacher_share_spec now has some re-enabled tests. It needed to be more careful about which thumbnail it was checking the visibility/shared state of.
  • The datacard_merge_spec was counting on clearQAData to remove the datacard tile within a single test. This was addressed by explicitly clearing the browser state before re-visiting the page. It could have also been fixed by splitting this into multiple tests. However we are still trying to minimize the number of Cypress tests we record in the cloud.

Other changes:

  • index.tsx was simplified by moving the appMode calculation inside of initializeApp.

Copy link

cypress bot commented Sep 4, 2024

collaborative-learning    Run #13695

Run Properties:  status check passed Passed #13695  •  git commit daa70c7a2f: remove unnecessary app react state
Project collaborative-learning
Branch Review 188211348-switch-to-fb-session-login
Run status status check passed Passed #13695
Run duration 13m 59s
Commit git commit daa70c7a2f: remove unnecessary app react state
Committer Scott Cytacki
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 4
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 110
View all changes introduced in this branch ↗︎

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.90%. Comparing base (72fee9a) to head (daa70c7).
Report is 43 commits behind head on master.

Files with missing lines Patch % Lines
src/initialize-app.tsx 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2396      +/-   ##
==========================================
+ Coverage   85.85%   85.90%   +0.04%     
==========================================
  Files         738      736       -2     
  Lines       37855    37816      -39     
  Branches     9635     9623      -12     
==========================================
- Hits        32502    32486      -16     
+ Misses       5046     5025      -21     
+ Partials      307      305       -2     
Flag Coverage Δ
cypress ?
cypress-regression 77.37% <97.05%> (+0.05%) ⬆️
cypress-smoke 28.06% <90.90%> (-0.01%) ⬇️
jest 48.75% <14.28%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@scytacki scytacki marked this pull request as ready for review September 6, 2024 14:05
Copy link
Contributor

@bgoldowsky bgoldowsky left a comment

Choose a reason for hiding this comment

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

This looks like a great simplification.

Comment on lines 141 to 142
public state: IState = {
qaCleared: false,
qaClearError: undefined
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to keep IState as an empty object?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should work fine without it. I'll remove it.

@scytacki
Copy link
Member Author

This is ready to be merged, but I'm going to wait until #2401 is merged and deployed. Otherwise we'll end up with a lot of extra realtime database roots.

@scytacki scytacki merged commit efadc22 into master Sep 11, 2024
17 checks passed
@scytacki scytacki deleted the 188211348-switch-to-fb-session-login branch September 11, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants