Problem/Motivation
When processing an item, Feeds generates a hash of this item and compares it with the hash generated from the previous import (if there was any).
The issue is that Feeds generates a hash of the whole item, which also may include data that is not used by any of the mappings. In some cases this can lead to unnecessary item updates, which will negatively impact performance.
An example:
Suppose you are creating user accounts from columns "name" and "email". In addition to those, the source contains a "changed" timestamp for each row. Whenever only the "changed" timestamp is updated, the user will be reimported by Feeds, but without any real changes to update.
This feature was implemented in the D7 version, but not yet ported to the D8 version.
For the D7 issue, see #1950182: Only update when mapped fields are updated..
Proposed resolution
Calculate the hash based on only the mapped sources (+ the mapping configuration).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | interdiff-2990155-5-7.txt | 751 bytes | megachriz |
| #7 | feeds-mapped-source-hash-check-2990155-7.patch | 6.86 KB | megachriz |
Comments
Comment #2
megachrizThis is a port of the patch from #1950182-17: Only update when mapped fields are updated.. The test
testIrrelevantUpdate()is slightly different implemented: we check if the manually changed node titles do not change on the second import. And we test with nodes instead of users.Comment #5
megachrizUpdated test
\Drupal\Tests\feeds\Kernel\Feeds\Processor\EntityProcessorBaseTest::testProcess().Comment #7
megachrizFor some reason when I ran the test locally, I did not get the warning that the testbot reported. Updated test
\Drupal\Tests\feeds\Kernel\Feeds\Processor\EntityProcessorBaseTest::testProcess()again.Comment #9
megachrizCommitted #7.