Queries that send the same request can share parsed results

オープン
#878 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
54/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php, wordpress
領域
backend

調査の方向性

Read the options and tradeoffs in issue #874, then trace how the parsed-results cache keys requests and how cache_get and cache_save are used. Check how the fix preserves duplicate suppression for failed and PUT, PATCH, or DELETE requests, along with subclass overrides and existing cache keys. Done means queries with the same request but different response processing no longer share parsed results.

索引モデルが issue の本文から書いたものです。

説明

Description

The in-memory cache for parsed results is keyed only by the request details. If two queries send the same request but process the response differently in one PHP request, the second gets the first one's result.

The same can happen within one query when an input changes the result but not the request.

Impact

Narrow. It mainly affects custom queries that share a URL, or the same data source set up twice with different mappings. The built-in Google Sheets item and list queries aren't affected, because the item query sends an extra header.

We haven't had a report of it.

Notes for a fix

  • The current behaviour also stops identical failed and PUT, PATCH or DELETE requests from being sent twice. A fix needs to keep that, or accept the change.
  • Changing cache_get or cache_save would break subclasses that override them.
  • A subclass may also rely on the current cache keys.

The options considered and their tradeoffs are in #874.

主要言語
PHP
スター
86
フォーク
14
平均マージ
1日 5時間
マージ済み PR(30日)
23

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/remote-data-blocks のほかの issue

Automattic/remote-data-blocks の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。