feat(19-04): add users.handle, HandleGenerator and user.Created

Generate a unique mention handle on API register and admin create, and fire user.Created from both paths so listeners run in the same write.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-17 21:44:59 +02:00
parent 569768e657
commit 15b19c7021
12 changed files with 349 additions and 19 deletions

View File

@@ -50,6 +50,7 @@ func TestCreateOrganisationsMigration(t *testing.T) {
"202610040002_add_users_last_seen",
"202610040003_create_frontend_permissions",
"202610050001_create_oauth_identities",
"202610160002_add_handle_to_users",
}
if len(ids) != len(want) {
t.Fatalf("history = %v", ids)
@@ -60,9 +61,9 @@ func TestCreateOrganisationsMigration(t *testing.T) {
}
}
// OAuth identities, the three admin migrations, API tokens, user groups, jwt blacklist,
// Handle, OAuth identities, the three admin migrations, API tokens, user groups, jwt blacklist,
// throttle, extend-users, then organisations.
for range 10 {
for range 11 {
if err := m.RollbackLast(); err != nil {
t.Fatal(err)
}