board logo
Posted by: WUICTeam - Friday, November 20, 2026 9:01:34 AM
[b]Question[/b] I call [c]wtoolbox.enqueueNotification({ roleId: 21, message: '...' })[/c] as a normal user. The request does not fail and the users I listed explicitly get the notification, but the role members get nothing and the method returns [c]false[/c]. What is happening? [b]Answer[/b] The server dropped the role. A role that is not allowed is discarded, but the rest of the call goes through: explicit users ([c]userId[/c]/[c]userIds[/c]) still receive the notification, and the response lists what was dropped in [c]refusedRoleIds[/c], with the reason for each in [c]refusedRoleReasons[/c]. The client helper turns that into [c]false[/c]. There are three reasons, and each has a different fix: [list] [*][c]role_fanout[/c]: sending to whole roles is allowed only to the superadmin, to the roles listed in the [c]notificationRoleFanOutRoles[/c] setting (role ids or names separated by commas, [c]*[/c] = every non-guest user, missing = superadmin only), or, from a saved workflow, to a role that the workflow names as a literal number in its own notification call. [*][c]too_many_recipients[/c]: a non-superadmin can reach at most 50 recipients per call. If the users of the role would push the call over that limit, the whole role is discarded, not truncated. [*][c]role_resolution_failed[/c]: the users of the role could not be resolved on the server. [/list] If there is no recipient left at all, you get a 403 with the same reason instead of a partial success. [b]Typical fix[/b] In the app settings, allow the sender's role: [code]"notificationRoleFanOutRoles": "Managers,Supervisors"[/code] In a workflow callback, write the role id literally inside the object: [code]await wtoolbox.enqueueNotification({ roleId: 21, type: 'workflow', message: 'Order approved' });[/code] [b]Pitfall to avoid[/b] A [c]roleId[/c] taken from a variable does not count as "named by the workflow": the server only recognizes the number written in the call. For a computed role, use [c]notificationRoleFanOutRoles[/c]. Also, do not treat the HTTP 200 as success: check [c]refusedRoleIds[/c] or the [c]false[/c] return value. [url=https://wuic-framework.com/docs/notifications]Documentation: Notifications[/url]