added user role update event#8674
Conversation
COMPARE TO
|
| Name | Diff |
|---|---|
| .gitattributes | 📈 +288 Bytes |
| Dockerfile | 📈 +310 Bytes |
| docker-compose.local.yml | 📈 +1.36 KB |
| package.json | 📈 +24 Bytes |
| packages/core/src/libraries/hook/context-manager.ts | 📈 +387 Bytes |
| packages/core/src/routes/admin-user/role.ts | 📈 +1.17 KB |
| packages/core/src/routes/organization/index.ts | 📈 +24 Bytes |
| packages/core/src/routes/organization/user/index.ts | 📈 +955 Bytes |
| packages/core/src/routes/organization/user/role-relations.ts | 📈 +2.14 KB |
| packages/core/src/routes/role.user.ts | 📈 +1.21 KB |
| packages/integration-tests/src/tests/api/hook/hook.trigger.data.test.ts | 📈 +3.54 KB |
| packages/integration-tests/src/tests/api/hook/test-cases.ts | 📈 +3.93 KB |
| packages/schemas/src/foundations/jsonb-types/hooks.ts | 📈 +465 Bytes |
wangsijie
left a comment
There was a problem hiding this comment.
🤖 PR Review
This PR adds role-update webhook events and richer payloads for management routes, plus local Docker setup changes.
- 🔒 Security: clean
- 🏗️ Architecture: 0 high, 3 medium
- 👨💻 Engineering: clean
Verdict:
|
@RjManhas, please check the failed CI jobs |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Thanks for working on this. I do not think this PR fully solves the original problem of capturing user role changes. The new
So consumers listening to these new events would still miss role changes. There is also the opposite issue: some routes may emit an Because of this, I do not think adding manual webhook triggers in these route handlers is enough to solve the original problem. If we want to guarantee coverage for role changes, the event should probably be emitted from a more centralized mutation path for user-role and organization-user-role relations, and role deletion should snapshot affected users before deletion so we can emit updates after cascade removal. |
Summary
Added new webhook events for when user or a user org roles are updated.
Testing
I tested it by building a docker compose, and testing api routes etc.
Checklist
.changeset