Commit be173eb
committed
fix: respect expired server TTL and use current token for cache storage
- Fix fallback TTL overriding explicitly expired server cache headers.
Changed isEntryFresh() to use serverTtl !== 0 (catches both positive
and negative values) instead of serverTtl > 0 (missed negative/expired).
Same fix in collectEntryMetadata() with explicit < 0 branch.
- Fix cache storing stale token after 401 refresh. Use getAuthToken()
(reads current DB value) instead of the captured token variable when
building cache request headers, so post-refresh tokens are stored.1 parent 414d870 commit be173eb
2 files changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | | - | |
238 | | - | |
| 239 | + | |
| 240 | + | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
242 | | - | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| |||
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
| 521 | + | |
| 522 | + | |
519 | 523 | | |
520 | 524 | | |
521 | 525 | | |
522 | 526 | | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
523 | 530 | | |
524 | | - | |
| 531 | + | |
525 | 532 | | |
526 | 533 | | |
527 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
| |||
0 commit comments