Skip to content

Fix rules notification scoping and reject scoped topic/condition push delivery (breaking change) - #3472

Open
ebariaux wants to merge 23 commits into
mainfrom
bugfix/rules-notifications-facade-scoping
Open

ebariaux wants to merge 23 commits into
mainfrom
bugfix/rules-notifications-facade-scoping

Conversation

@ebariaux

Copy link
Copy Markdown
Contributor

Description

Closes gaps in notification authorization for realm- and asset-scoped rules, including Groovy rules using notifications.send().

  • Reject missing USER targets before recipient expansion or persistence.
  • Require restricted recipients of asset-scoped rules to be directly linked to the rule’s scoped asset. Unrestricted recipients do not require this link.
  • Keep expanded push and email recipients within the rule’s realm.
  • Exclude service and system accounts from scoped asset-to-user push expansion.
  • Keep delivery consoles within the rule’s realm. An eligible user’s console may be outside the rule’s asset subtree.
  • Apply the same restrictions when expanding localized notifications.
  • Reject CUSTOM targets for DEVICE push delivery before any targets are processed.
  • Fix global-rule notification submission failing because of a null source ID.

Invalid explicit targets reject the whole request. Ineligible recipients discovered during expansion are filtered, preserving eligible recipients.

Breaking change and migration

Realm- and asset-scoped rules can no longer send push notifications using PushNotificationMessage.targetType TOPIC or CONDITION. Firebase resolves these audiences, so their realm and asset scope cannot currently be verified.

Rejection happens before notification records are stored or delivery is attempted. This includes Groovy rules and localized messages containing a TOPIC or CONDITION variant, even when other variants or notification targets are valid.

Use DEVICE delivery, or omit targetType to use its DEVICE default, with permitted OpenRemote USER, ASSET or REALM targets for the rule’s scope. Asset-scoped rules cannot target an entire REALM, and restricted user recipients must be directly linked to the scoped asset.

DEVICE push notifications also reject CUSTOM targets; use supported OpenRemote targets instead.

Global rules and internal notifications retain their existing TOPIC/CONDITION handling.

@ebariaux ebariaux added Bug Error or issue in the system Breaking Change Indicates that a PR includes a breaking change labels Oct 23, 2026
@ebariaux
ebariaux requested a review from a team October 23, 2026 07:52
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking Change Indicates that a PR includes a breaking change Bug Error or issue in the system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant