Flush queued messages for skipped row when trackChanges is active

Created on 17 December 2020, over 3 years ago
Updated 11 May 2023, about 1 year ago

Problem/Motivation

If trackChanges option is active, migrate module calls prepareRow() method for all records (even already migrated) and then tests if source data changed or not. If not, the row (record) is skipped.

If a message is queued inside the prepareRow(), the row is skipped, but the message remains in the queue until the first row is really imported. Then all the cumulated messages are saved to the processed record.

Steps to reproduce

- set up trackChanges to TRUE,
- run migrate import with some limit (your code must queueing some messages in prepareRow)
- check migration messages table
- run migrate import again
- check migration messages table. All previously stored messages are duplicated and assigned to the first record imported with the second run.

Proposed resolution

Flush queued messages before skipping unchanged row.
Apply the patch.

User interface changes

No.

API changes

No.

Data model changes

No.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡ΏCzech Republic martin_klima

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024