-
Notifications
You must be signed in to change notification settings - Fork 543
Description
Hi,
When non-salesforce platform publishers publish Platform Events through the PubSub API, they are required to meet the Schema of the platform event.
This also includes two fields that are generally not provided by salesforce platform publishers (apex, flows, etc) :
CreateDate: appears to be ignored, and the Event bus handles the timestamping.CreateById: MUST match the id of user authenticated to the pubsub api
Failing to do that :
- Message is accepted by the pubsub API and returns a replay ID
- No automation (Platform event Flow or Platform event trigger) are triggered. Nor is any log provided to help trouble shoot
This is a follow up to issue pozil/pub-sub-api-node-client#17
This was also discussed with support in case 500Hx00000K444jIAB (#45348057)
Steps to reproduce
- Create a new platform event, no custom field required
- Add a simple Platform Event Trigger (that only throws an exception) or Platform event Flow (that only causes) on this platform event
- Enable finest debug log on the intergration user
- Implement any client outside salesforce platform using any language (i went for Node using @pozil 's https://github.com/pozil/pub-sub-api-node-client/)
- Publish a platform event with
CreatedById=WHATEVERas the intergration user
Observed Outcome
The pubsub api provides the client with a replay id
NO Executition of the trigger nor flow (no log generated for the interview nor Code Unit)
Expected outcome (Strict)
The pubsub api rejects the message with error Invalid user Id : Must match the Id of Authenticated user or something along the way
Expected outcome (devFriendly)
The pubsub accepts the message, but overrides the value provided in CreatedById to match user posting the platform event through pubsub api
The flow and trigger execute without issue.