-
[Workavia] Drop double-save in remote.ts that wiped user.cache.companies
released this
2026-05-02 20:06:53 +00:00 | 0 commits to main since this releaseUpstream OIDC remote.updateUser does:
- users.save(user) — basic fields, cache.companies unset
- companies.setUserRole(company, user) — fetches fresh user, pushes
company id into cache.companies, users.save() that fresh user - users.save(user) — saves the LOCAL stale user, overwriting (2)
Step 3 is what breaks: cache.companies ends up empty in DB, the user
search index loses the companies field, and the share-picker can't
find users from the same Company.Removing step 3 fixes it: setUserRole's save is the authoritative one.
Downloads