Repository navigation
Commit debfc35
Validate the cached WordPress versions data before using it
The fetch path checked that a response was a non-empty object before
caching it, but the read path only checked that the file was not empty.
An unparsable cache was therefore handed straight to jq, which meant a
run inside the TTL made no request at all, leaked a jq parse error, and
continued with an empty WP_VERSION -- silently dropping the
@require-wp-* filtering that the cache was added to protect. Every
subsequent run repeated it until the entry aged out.
Both paths now share one check, so an unusable cache counts as a miss
and the network gets a chance to replace it.
The TTL validation moves into get_wp_versions along with it, so that a
typo is only reported when a lookup is actually going to happen rather
than on every run, and its warning joins the other one on STDERR.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GjJi6F76YZBt7cRrvXS6s61 parent 93b00e7 commit debfc35
1 file changed
Lines changed: 22 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
| |||
134 | 132 | | |
135 | 133 | | |
136 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
| |||
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
170 | 182 | | |
171 | | - | |
| 183 | + | |
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
| |||
179 | 191 | | |
180 | 192 | | |
181 | 193 | | |
182 | | - | |
| 194 | + | |
183 | 195 | | |
184 | 196 | | |
185 | 197 | | |
| |||
201 | 213 | | |
202 | 214 | | |
203 | 215 | | |
204 | | - | |
| 216 | + | |
205 | 217 | | |
206 | 218 | | |
207 | 219 | | |
| |||
0 commit comments