Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 573e4a0cb4 |
@@ -214,8 +214,16 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
|
||||
|
||||
await gr.services.companies.setUserRole(company.id, user.id, userRole);
|
||||
|
||||
await gr.services.users.save(user, { user: { id: user.id, server_request: true } });
|
||||
|
||||
// [Workavia] Removed an upstream `users.save(user, ...)` here that
|
||||
// overwrote the user record after setUserRole (line above) had
|
||||
// already fetched a fresh user, pushed the new companyId into
|
||||
// user.cache.companies, and saved. Saving the stale local `user`
|
||||
// object on top wiped cache.companies → the OpenSearch `user` index
|
||||
// ended up with an empty `companies` field → frontend share-picker
|
||||
// search returned zero results for same-Company users. Without this
|
||||
// double-save, setUserRole's save is the last write and the index
|
||||
// is correct. Surfacing this comment so it doesn't get reintroduced
|
||||
// on rebase.
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user