Problem/Motivation

In #3498231: Split results storage in keyValue per plugin instead of global we created the ability for our "caching" (in Key-Value storage) to be segmented better. This will now enable us to prevent caching data where an error comes back from the backend.

Steps to reproduce

Proposed resolution

Wrap the $this->keyValue->set()s in our backend plugins in something like "if (empty($result->error))"

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

chrisfromredfin created an issue. See original summary.

fjgarlin’s picture

We should probably ship #3498560: EnabledSourceHandler should segment its storage more strongly before tackling this.

Suggested code, if the above is merged:

    if (empty($results->error)) {
      // Store the query results as a set of arguments to ProjectsResultsPage only if there are no errors.
      $storage->set($cache_key, [
        $results->totalResults,
        array_column($results->list, 'id'),
        $results->pluginLabel,
        $source_id,
        $results->error,
      ]);
    }

phenaproxima made their first commit to this issue’s fork.

phenaproxima’s picture

Status: Active » Needs review
fjgarlin’s picture

Status: Needs review » Reviewed & tested by the community

The code looks good and the test shows that when there is an error nothing gets stored. RTBC.

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

feed-baby-airplane-into-hangar.gif

Status: Fixed » Closed (fixed)

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