fix: User updates are not synced between clients (#6490)

* Add Model.changeset method to get minified changes since last update

* fix: Handle arrays

* Add changes column, types

* test
This commit is contained in:
Tom Moor
2024-02-04 10:36:43 -08:00
committed by GitHub
parent 06ab5e5f44
commit 234613580d
11 changed files with 295 additions and 55 deletions

View File

@@ -88,6 +88,7 @@ class WebsocketProvider extends React.Component<Props> {
pins,
stars,
memberships,
users,
userMemberships,
policies,
comments,
@@ -509,6 +510,10 @@ class WebsocketProvider extends React.Component<Props> {
}
);
this.socket.on("users.update", (event: PartialWithId<User>) => {
users.add(event);
});
this.socket.on("users.demote", async (event: PartialWithId<User>) => {
if (event.id === auth.user?.id) {
documents.all.forEach((document) => policies.remove(document.id));