We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 407185f commit a451af2Copy full SHA for a451af2
1 file changed
server/src/utils/pca.ts
@@ -327,7 +327,14 @@ export function getPca(
327
}
328
const cachedPOJO = cached && cached.asPOJO;
329
if (cachedPOJO) {
330
- if (cachedPOJO.math_tick <= (math_tick || 0)) {
+ // When caller wants the latest data (math_tick undefined or -1), return cached data
331
+ // This includes empty structures (math_tick: 0) created when no math data exists
332
+ if (math_tick === undefined || math_tick === -1) {
333
+ logger.silly("math from cache (latest requested)", { zid, math_tick });
334
+ return Promise.resolve(cached);
335
+ }
336
+ // When caller specifies a math_tick, only return cached data if it's newer
337
+ if (cachedPOJO.math_tick <= math_tick) {
338
logger.info("math was cached but not new", {
339
zid,
340
cached_math_tick: cachedPOJO.math_tick,
0 commit comments