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).

Comments

MegaChriz created an issue. See original summary.

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new2.76 KB
new6.03 KB

This 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.

Status: Needs review » Needs work

The last submitted patch, 2: feeds-mapped-source-hash-check-2990155-2.patch, failed testing. View results

megachriz’s picture

Status: Needs work » Needs review
StatusFileSize
new6.73 KB
new720 bytes

Updated test \Drupal\Tests\feeds\Kernel\Feeds\Processor\EntityProcessorBaseTest::testProcess().

Status: Needs review » Needs work

The last submitted patch, 5: feeds-mapped-source-hash-check-2990155-5.patch, failed testing. View results

megachriz’s picture

Status: Needs work » Needs review
StatusFileSize
new6.86 KB
new751 bytes

For 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.

  • MegaChriz committed 781bb76 on 8.x-3.x
    Issue #2990155 by MegaChriz: Only update when mapped fields are updated.
    
megachriz’s picture

Status: Needs review » Fixed

Committed #7.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.