Skip to content

Reconcile policies again when the signed-in user changes - #7966

Draft
Frooodle wants to merge 1 commit into
feature/desktop-onboarding-magic-trickfrom
refetch-policies-on-sign-in
Draft

Reconcile policies again when the signed-in user changes#7966
Frooodle wants to merge 1 commit into
feature/desktop-onboarding-magic-trickfrom
refetch-policies-on-sign-in

Conversation

@Frooodle

Copy link
Copy Markdown
Member

Description of Changes

  • usePolicies reconciled only on mount, so a fetch that ran before there was a session left every category in its unconfigured default.
  • That default is indistinguishable from "the backend has no policy", because policyStorage.defaultState() returns exactly the same shape.
  • The local-pass engine reads it as "no policy" and stops running, so classification is silently dormant — on uploads, not just the Downloads offer.
  • Reconcile now re-runs whenever the signed-in user changes, which repopulates the cache from the backend after login.
  • Also re-runs on sign-out, so one user's policies do not linger for the next.

Why: reproduced on a real desktop install — the Policies page read the backend live and showed Classification enabled, while the app's own cache said unconfigured and nothing classified.

Scope: shared policy plumbing, so it affects web and SaaS as well as desktop. Independent of the other desktop PRs.

Known remaining: the cache still cannot express "unknown" versus "off". This removes the common cause rather than the conflation itself.

Ran: frontend:typecheck:all, frontend:lint, frontend:format:check, full vitest (3440), comment-lint.


Checklist

General

Documentation

Translations (if applicable)

UI Changes (if applicable)

  • Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • I have run task check to verify linters, typechecks, and tests pass
  • I have tested my changes locally. Refer to the Testing Guide for more details.

@Frooodle
Frooodle requested review from a team and balazs-szucs as code owners September 12, 2026 19:09
@Frooodle
Frooodle marked this pull request as draft September 12, 2026 19:11
@github-actions

Copy link
Copy Markdown
Contributor

🚀 V2 Auto-Deployment Complete!

🔗 Direct Test URL (non-SSL) http://54.175.155.236:7966

🧩 Admin portal included - try it at http://54.175.155.236:7966/portal.

This deployment will be automatically cleaned up when the PR is closed.

🔄 Auto-deployed for approved V2 contributors.

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.

1 participant