Data Discrepancy Between Publish Event and Update Event

There is a discrepancy between the data provided in the publish event and the content of the update event. Specifically, the propertyD field has different values ('' in the publish event and 'fr' in the update event). This inconsistency could lead to unexpected behavior and requires investigation.

I’m submitting a…

  • Regression (a behavior that stopped working in a new release)
  • Bug report
  • Performance issue
  • Documentation issue or request

Current behavior

Publish event content

{ propertyA: { iv: true }, propertyB: { iv: false }, propertyC: { iv: true }, propertyD: { iv: '' } }

Update event content

{ propertyA: { iv: true }, propertyB: { iv: false }, propertyC: { iv: true }, propertyD: { iv: 'fr' }, propertyE: { iv: [ [Object] ] }, propertyF: { iv: 'icon' }, propertyG: { iv: 'or' }, ... }

Expected behavior

Why do I receive a JSON with only four properties during a publish event? Shouldn’t I receive all properties in the publish event?

Minimal reproduction of the problem

Create a schema named mySchema-stage along with its corresponding data. Then, setup a manual webhook with the following functionalities:

  1. Read the data from the mySchema-stage.
  2. Utilize this data to create a new schema named mySchema-prod.
  3. Once mySchema-prod is successfully created, establish a content change webhook to automatically send data to a specified backend.
  4. Update the content of the mySchema-prod with the data retrieved from the mySchema-stage. This action will trigger the content change webhook, initiating publish and update events to the specified API endpoint.

Environment

App Name:

  • Self hosted with docker
  • Self hosted with IIS
  • Self hosted with other version
  • Cloud version

Version: [VERSION]

Browser:

  • Chrome (desktop)
  • Chrome (Android)
  • Chrome (iOS)
  • Firefox
  • Safari (desktop)
  • Safari (iOS)
  • IE
  • Edge

Others:
One more thing, seems when we trigger to many events we did not receive all of them.

I don’t understand your reproduction case and in which order you are doing things, e.g.

Update the content of the mySchema-prod with the data retrieved from the mySchema-stage. This action will trigger the content change webhook, initiating publish and update events to the specified API endpoint.

Why is this needed for reproduction and why should an update trigger a publish event?

Here’s the scenario: I have a template schema, let’s call it schemaA. I also have code that reads the structure and content of schemaA with API and creates schemaB with identical structure and content (essentially making a copy). Additionally, for the newly created schemaB, I’ve set up a Content Change webhook that sends all modifications of schemaB to my backend.

The issue is when I receive the first publish event:

  1. I’m not receiving the complete list of schemaB fields in the event payload data(after I fill data that I get from schemaA into SchemaB)
  2. It’s unclear why I’m receiving fields that are neither required nor have default values.

Note, as I understood this happens for singleton schemas.
The reson why I need this functionality is the following - I have stage and production environments, and I need to somehow sync all stage changes in production.

I think there must be something wrong on your side. The description is also not concrete and I don’t know how to reproduce that.

Squidex uses event sourcing, which means that everything that happens is stores as an event, which is the source of many features. Event regular updates somehow use events. If there would be something wrong, a lot of features would break.

Some things to consider:

  • Webhooks are not sent immediately in the update request. But in a background process.
  • Webhooks are retried, therefore it could theoretically happen that a later event arrives before an earlier event.
  • Depending your tech stack and because of serialization and deserialization an object might be transformed by accident. This happens relatively often.
  • Rule events are recorded. It would be helpful to understand if you can reproduce it in the event logs.