| @@ -193,12 +193,23 @@ | ||
| 193 | 193 | if ( ! $data['success'] ) { |
| 194 | 194 | /** |
| 195 | 195 | * Error. |
| 196 | 196 | */ |
| 197 | - $old_data['data']['sizes'][ $size ] = [ | |
| 197 | + $size_data = [ | |
| 198 | 198 | 'success' => false, |
| 199 | 199 | 'error' => $data['error'], |
| 200 | 200 | ]; |
| 201 | + | |
| 202 | + if ( ! empty( $data['permanent_error'] ) ) { | |
| 203 | + /** | |
| 204 | + * `permanent_error` is written as the FIRST key on purpose: the bulk queries match the | |
| 205 | + * serialized data with a LIKE on the `<size>";a:3:{s:15:"permanent_error";b:1;` prefix, | |
| 206 | + * which only stays deterministic if the key order does. | |
| 207 | + */ | |
| 208 | + $size_data = array_merge( [ 'permanent_error' => true ], $size_data ); | |
| 209 | + } | |
| 210 | + | |
| 211 | + $old_data['data']['sizes'][ $size ] = $size_data; | |
| 201 | 212 | } else { |
| 202 | 213 | /** |
| 203 | 214 | * Success. |
| 204 | 215 | */ |