Restoring users with topics and subscriptions after soft deletion.

36 views
Skip to first unread message

Alex Frost

unread,
Mar 26, 2024, 9:51:13 AMMar 26
to Tinode General
I'm using postgres db.
After soft deletion, the user state, his topics state and subscriptions state changes to `StateDeleted`
I can restore the user using the `Update` and UpdateState` methods of `usersMapper` struct. Which use `UserUpdate` method of postgres adapter.
But, how can I restore user's topics and subscriptions? Are there any methods or perhaps there is another way to restore a user after a soft deletion?

Gene

unread,
Mar 26, 2024, 11:40:27 AMMar 26
to Tinode General
These is no method to un-soft-delete users because no one ever asked for it. If you need it you can create it. For example, you can generalize UserDelete(uid t.Uid, hard bool) to change State to whatever state you want as opposite to hard-coded StateDeleted.

Alex Frost

unread,
Mar 26, 2024, 12:49:56 PMMar 26
to Tinode General
Got it, thanks for the clarification and response

вторник, 26 марта 2024 г. в 18:40:27 UTC+3, Gene:
Reply all
Reply to author
Forward
0 new messages