Fix profiles losing their selected users
Starting an M365 scan wrote the sidebar state back into the active profile via _save_settings(), replacing its user_ids with the sidebar selection (minus Google-only users and anything hidden by the role filter). With no profile active it overwrote profiles[0]. Profiles are loaders, so scan start no longer writes them; profile_id is audit-only. The profile editor built its account list from S._allUsers only, so manually added accounts, users not yet loaded, and users gone from the directory were not rendered and got dropped on the next save. They now render as checked "Manual" / "Not loaded" rows, and user_ids "all" is kept when saved before users load. Applying a profile cleared the pending user IDs before the un-awaited Google merge had added google:<email> users, leaving them unticked. Pending IDs are now kept until all are matched or the user list is final, and _mergeGoogleUsers() re-applies them. A saved google:<email> also matches an M365 user merged to platform 'both'. Adds regression tests for scan start leaving profiles untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b77bf70ff5
commit
bbe9c62ff9
10 files changed
+146
-17
No files matched your search
@@ -19,6 +19,7 @@ export const S = {
|
||||
_progressCurrentUser: '',
|
||||
// Users
|
||||
_allUsers: [],
|
||||
_googleUsersMerged: false, // true once _mergeGoogleUsers() has added Google users
|
||||
// Auth
|
||||
_currentAppMode: null,
|
||||
// Profiles
|
||||
|
||||
Reference in new issue
Block a user