Skip to content

Commit e4dc806

Browse files
committed
feat: delete unconfirmed users
1 parent 0c2d22b commit e4dc806

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

doc/rfcs/inactive_users_cleanup.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Inactive user cleanup
2+
When user registration process finishes and users not passing "activation", corresponding DB record stays for ttl.
3+
But all metadata/alias/email records stay forever.
4+
5+
#### Possible variant
6+
- Create additional set with id's of inactive users (`users-activate`).
7+
* Change activation process: remove successfully activated user id from `users-activate`.
8+
* Change registration process: insert inactive user id into `users-activate`.
9+
- Add repeating task with interval `config.incativeCleanupInterval`.
10+
* Sets `dlock` for cleanup operation
11+
* Gets list from `user-activate`
12+
* Delete all corresponding data from DB for this user id's:
13+
all keys `{id}!metadata!{audience}`, and keys from hashes: `USERS_USERNAME_TO_ID`,`USERS_ALIAS_TO_ID`.
14+
15+
_NOTE_:
16+
User already can be assigned to some organization. So we'll check organisation members key (`redisKey(organizationId, ORGANIZATIONS_MEMBERS)`), organisation member key (`redisKey(organizationId, ORGANIZATIONS_MEMBERS, member.email)`) and redisKey(member.email, USERS_ORGANIZATIONS);
17+

0 commit comments

Comments
 (0)