Skip to content

Conversation

@BenjaminCharmes
Copy link
Contributor

Closes #492

Changes default landing page behavior based on authentication status.

  • Non-authenticated users: redirected to About page
  • Authenticated users: redirected to Samples page

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.12%. Comparing base (a40cc83) to head (72f60f0).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1483    +/-   ##
========================================
  Coverage   79.11%   79.12%            
========================================
  Files          70       71     +1     
  Lines        5229     5413   +184     
========================================
+ Hits         4137     4283   +146     
- Misses       1092     1130    +38     

see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link

cypress bot commented Dec 9, 2025

datalab    Run #4377

Run Properties:  status check passed Passed #4377  •  git commit fd50458181 ℹ️: Merge 72f60f0a44dd498b1a4daeb9f7e9e8f12dfe9aeb into 020cc770e22581fddcfdfdba2feb...
Project datalab
Branch Review bc/default-page
Run status status check passed Passed #4377
Run duration 08m 37s
Commit git commit fd50458181 ℹ️: Merge 72f60f0a44dd498b1a4daeb9f7e9e8f12dfe9aeb into 020cc770e22581fddcfdfdba2feb...
Committer Ben Charmes
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 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 458
View all changes introduced in this branch ↗︎

@BenjaminCharmes BenjaminCharmes marked this pull request as ready for review December 9, 2025 12:56
@ml-evs ml-evs added this to the v0.7.x milestone Dec 17, 2025
ml-evs
ml-evs previously approved these changes Dec 18, 2025
Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

Works well, thanks!

Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

Hmmm, actually, just testing it a bit and realising that every load page now hits /get-current-user 3 times, with this PR adding the extra one... could you take a look at this and make better use of the store/cache and the setCurrentUserInfoLoading state in the store?

@BenjaminCharmes
Copy link
Contributor Author

Hmmm, actually, just testing it a bit and realising that every load page now hits /get-current-user 3 times, with this PR adding the extra one... could you take a look at this and make better use of the store/cache and the setCurrentUserInfoLoading state in the store?

Moved the auth logic into a Vuex action that stores the in-flight Promise in state. This prevents the 3 concurrent /get-current-user calls - now only one request is made on page load.

@ml-evs ml-evs force-pushed the bc/default-page branch 2 times, most recently from 40f55b4 to c6c703f Compare December 18, 2025 17:07

commit("setCurrentUserInfoLoading", true);

const promise = fetch(`${API_URL}/get-current-user/`, {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry to be a pain but I'd rather all the direct API fetches are done in server_fetch_utils, we likely need to use the fetch_get wrapper there anywhere.

Could you put this back there and manage the store state upon request?

Copy link
Member

Choose a reason for hiding this comment

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

Taking another quick look at where else this is used in the code, we need to make sure we can invalidate the user info cache when the user changes their own info, for e.g.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, of course, it makes more sense!

I've moved back the fetch logic to server_fetch_utils with a cache system to prevent multiple /get-current-user/ calls. The cache is invalidated when users update their info in EditAccountSettingsModal.

I kept the fetchCurrentUser action in the store to handle the fullInfo parameter and return cached data when available. Let me know if you'd prefer a different approach - happy to adjust!

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.

Make the default non-logged in page "About" rather than "Samples"

3 participants