clients icon indicating copy to clipboard operation
clients copied to clipboard

[PS-1092] Organization Service Observables

Open justindbaur opened this issue 1 year ago • 1 comments

Type of change

- [ ] Bug fix
- [ ] New feature development
- [x] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Adds a organizations$ observable so that the latest organization data can be subscribed to.

Code changes

  • Provide an observable for current users organizations
  • Subscribe to that observable throughout places in the UI so it is reactive

Screenshots

Before you submit

  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

justindbaur avatar Sep 07 '22 19:09 justindbaur

As you pointed out, I'm concerned about the full sync moves. It feels possible that some esoteric flow expects the sync to occur exactly where it currently is, not right after update.

Just concerned about losing this element of control. @eliykat: Can you speak to this regarding key connector?

I haven't reviewed the whole PR, but just looking at moving syncService.fullSync calls from components to the organizationApiService, as it affects key connector: this seems fine to me.

  • When a user chooses to leave the organization rather than enrolling in Key Connector (RemovePasswordComponent) - that's fine, fullSync was the very next command anyway. The important thing is that they've left the org and lose access to its items.
  • When determining whether a user needs to be migrated to Key Connector - that's always handled immediately after a full sync, kicked off by SyncService itself - which it probably shouldn't be - but that means it's always done in the right order (sync then check)
  • when logging in with Key Connector - doesn't depend on synced organization data (key connector url comes from the tokenResponse)

This is all I could think of, but if you had some specific concern I haven't addressed then let me know. (EDIT: just saw and responded to your inline question as well)

eliykat avatar Sep 14 '22 02:09 eliykat