Skip to content

fix preference error#830

Open
SharonStrats wants to merge 3 commits into
stagingfrom
fix/pref-warning
Open

fix preference error#830
SharonStrats wants to merge 3 commits into
stagingfrom
fix/pref-warning

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Another attempt to fix the preference error.

When logging out there were 2 user preferences errors when we shouldn't need to load preferences anyway when logging out.

when logging in there was one error, it shouldn't try to retrieve them until the user log in details are stored.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to prevent “preference error” scenarios by avoiding preference-file loading when no user is logged in, and by making role lookup resilient to logged-out state.

Changes:

  • Add an early return in recordPersonalDefaults when context.me is missing to skip preference loading.
  • Update getUserRoles to return an empty role list when no current user is present.
  • Add a unit test ensuring recordPersonalDefaults doesn’t attempt to load preferences when logged out.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
test/unit/preferences.test.ts Adds a regression test around logged-out behavior for recordPersonalDefaults.
src/login/login.ts Avoids preference loading in getUserRoles when there is no current user.
src/lib/preferences.js Skips personal-defaults preference loading when context.me is not set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/login/login.ts Outdated
Comment thread test/unit/preferences.test.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@SharonStrats SharonStrats requested a review from bourgeoa July 4, 2026 04:36
@SharonStrats SharonStrats moved this to In review in SolidOS NLNet UI Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants