Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing from outside platform - Inexact CreatedById causes event not to fire triggers or flows #42

Open
gaelguimini opened this issue Oct 3, 2023 · 0 comments

Comments

@gaelguimini
Copy link

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 :

  1. Message is accepted by the pubsub API and returns a replay ID
  2. 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

  1. Create a new platform event, no custom field required
  2. Add a simple Platform Event Trigger (that only throws an exception) or Platform event Flow (that only causes) on this platform event
  3. Enable finest debug log on the intergration user
  4. 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/)
  5. Publish a platform event with CreatedById=WHATEVER as 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant