Skip to content

fix: after login user header reload#49

Merged
BretRen merged 2 commits into
mainfrom
fix/login-reload
Apr 28, 2026
Merged

fix: after login user header reload#49
BretRen merged 2 commits into
mainfrom
fix/login-reload

Conversation

@BretRen
Copy link
Copy Markdown
Member

@BretRen BretRen commented Apr 28, 2026

Description

Fixed after login user header reload problem

Related Issue

#43

Type of Change

  • 🚀 New Feature (feat)
  • 🐛 Bug Fix (fix)
  • 📝 Documentation Update (docs)
  • 🎨 Style/UI Adjustment (ui)
  • ⚡ Performance Optimization (perf)

How to Test

No Test Needed

Checklist

  • Code has passed local tests
  • Adheres to the project's coding standards
  • Relevant documentation has been updated where necessary

Summary by CodeRabbit

  • Bug Fixes
    • Improved authentication state tracking to update in real-time when login status changes.

@BretRen BretRen linked an issue Apr 28, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@BretRen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 31 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bdb75898-ec33-439b-a1b0-b95bb54724ad

📥 Commits

Reviewing files that changed from the base of the PR and between 56b7e7c and 22c8509.

📒 Files selected for processing (1)
  • website/src/routes/+layout.svelte
📝 Walkthrough

Walkthrough

The layout component's authentication handling was refactored to use reactive subscription. A reloadLoginStatus() function now updates the user state based on the auth store's validity, and the component subscribes to auth store changes instead of relying on one-time initialization via onMount.

Changes

Cohort / File(s) Summary
Authentication Reactivity Refactor
website/src/routes/+layout.svelte
Replaced one-time onMount initialization with reactive subscription to pb.authStore.onChange. Extracted user state update logic into reloadLoginStatus() function that checks auth validity and assigns/clears user accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit's whisper on the wind:
The auth store whispers, and we listen now,
No longer frozen in the mounting bow,
Each change cascades through subscribed state,
User flows like clover, fresh and great! 🍀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly addresses the main change: fixing user header reload after login, which matches the core functionality modification in the layout component.
Description check ✅ Passed The description includes all required template sections with appropriate detail, though the testing description could be more informative.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/login-reload

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the root layout to reactively manage user authentication state using PocketBase. The review feedback identifies a bug where the status reload function is referenced without being called, as well as a critical memory leak and SSR issue caused by placing the authentication listener at the top level of the script. Additionally, the reviewer noted redundant logic in the state initialization and inconsistent semicolon usage.

Comment thread website/src/routes/+layout.svelte Outdated
Comment thread website/src/routes/+layout.svelte
@BretRen BretRen merged commit 58fc56e into main Apr 28, 2026
@BretRen BretRen deleted the fix/login-reload branch April 28, 2026 02:46
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.

After login the header is not reload

1 participant