Sq sync in command fires events

I have…

  • [x] Checked the logs and have uploaded a log file and provided a link because I found something suspicious there. Please do not post the log file in the topic because very often something important is missing.

I’m submitting a…

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

Current behavior

When we run the command ‘sq sync in backup’ (where backup is the folder where we store the contents) the command imports all the contents as intended but occasionally fires events for each imported item. See - app gp2-2510

Expected behavior

When the above command is run it should never fire events - see app gp2-2508.

Minimal reproduction of the problem

The issue is intermittent but we were able to capture it in the apps listed above.

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

Version: [VERSION]

Browser:

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

Others:

What kind of events do you mean? But in general: The sync command does not use any special API endpoints and only makes the updates using the same endpoints that you might also use.

Hello,

Thank you for you quick reponse @Sebastian

The events I mean are the Rule Events, we have run the sq sync in command for two separate applications, for the app gp2-2508 the records show zero emitted events afterwards:

Whereas for app gp2-2510 there are hundreds:

We generally create apps through our CI and once we run the command it almost never fires these events which contradicts what you just said about the sync command making regular updates, however on some occasions it fires them all.

Is there a reason for such discrepancy?

It depends on 3 things:

  1. The sync order: If the has to create several rules and content items it depends on the order. If the rules are synced first, the content could create afterwards (see point 3). But usually the rules are synced last if you do not make a sync in multiple phases.
  2. The synced content and settings: If the rule is created during the sync, the content items would not create events, but if the rule already exists, the contents would create events.
  3. The rule cache. There is a short cache of a few minutes. So, if the rule has just been created it usually does not trigger events.

Technically it would be possible to add a header to the api which would prevent all events. Perhaps we should implement it like this.

I see - so this might just come down to the order in which the command imports the rules, is that right?

Are you able to tell me which of these relates to rules

Executing the following steps
* STEP 0 of 3: Schemas
* STEP 1 of 3: App
* STEP 2 of 3: Contents

--------------------------------------------------------
* STEP 0 of 3: Importing Schemas started

Schema dashboard creating...            succeeded.
Schema working-groups creating...       succeeded.
Schema external-authors creating...     succeeded.
Schema events creating...               succeeded.
Schema pages creating...                succeeded.
Schema groups creating...               succeeded.
Schema research-tags creating...        succeeded.
Schema news-and-events creating...      succeeded.
Schema teams creating...                succeeded.
Schema users creating...                succeeded.
Schema labs creating...                 succeeded.
Schema tutorials creating...            succeeded.
Schema migrations creating...           succeeded.
Schema research-outputs creating...     succeeded.
Schema calendars creating...            succeeded.
Schema discover creating...             succeeded.
Schema dashboard updating...            succeeded.
Schema working-groups updating...       succeeded.
Schema external-authors updating...     succeeded.
Schema events updating...               succeeded.
Schema pages updating...                succeeded.
Schema groups updating...               succeeded.
Schema research-tags updating...        succeeded.
Schema news-and-events updating...      succeeded.
Schema teams updating...                succeeded.
Schema users updating...                succeeded.
Schema labs updating...                 succeeded.
Schema tutorials updating...            succeeded.
Schema migrations updating...           succeeded.
Schema research-outputs updating...     succeeded.
Schema calendars updating...            succeeded.
Schema discover updating...             succeeded.

* STEP 0 of 3: Importing Schemas completed
--------------------------------------------------------

--------------------------------------------------------
* STEP 1 of 3: Importing App started


* STEP 1 of 3: Importing App completed
--------------------------------------------------------

--------------------------------------------------------
* STEP 2 of 3: Importing Contents started


* STEP 2 of 3: Importing Contents completed
--------------------------------------------------------
> Synchronization completed.

None, it seems you are not running rule sync here. But there is also no content

  1. Before syncing it logs the targets and there is no rule
  2. It should report some status for content when something has be to be synced and there is nothing