Repository navigation
fix(lib): bound the memory cache, follow fetch redirect rules, lint chained test modifiers - #2447
Conversation
…hained test modifiers Audit fixes in the shared libraries and small packages. - cache: the in-memory backend sweeps expired entries on put once the map has doubled, so keys with a rotating part no longer accumulate forever. A non-finite TTL is not stored (NaN never compared as expired). - safe-fetch: without strictRedirects a 303 now turns anything but GET or HEAD into a body-less GET and a 301 or 302 does the same for POST, as the fetch standard says. 307 and 308 still replay method and body. Dropping the body also drops content-encoding, content-language and content-location. - oxlint-config: test-slop walks the whole modifier chain, so it.effect.skip(...) and it.live.each(rows)(...) count as tests and no-weak-only-assertions fires inside them. No test file in the repo uses a chained modifier today. - strings: escapeHtml and the at-most-max truncate live in @maple/strings; the copies in email, status-page and chat-platform are gone. - Removed exports nothing imports: blockRefs, MAX_STRING_LITERAL_BYTES, escalationStepCount (its test keeps the assertion with a plain expectation), and un-exported agentLimitName, computeAgentTime and groupFailures. - Corrected stale comments in cache and prometheus-otlp.
This comment has been minimized.
This comment has been minimized.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@maple-review-bot won't fix F1 in this PR. The one-character difference is known and was left on purpose: the email |
|
Fair — checking it at the head commit, the two are not silently interchangeable and nothing in this PR depends on them matching:
And the three email renderers still import F1 can be dismissed. A one-line note on the shared |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Maple review🟢 Confidence 10/10 · safe to merge. Eviction, redirect and lint fixes are pinned by new tests; only the deliberate one-character Bounds the in-memory cache backend, makes non-strict redirects follow the fetch standard, and stops
Still open from earlier reviews
|
* fix(status-page): import escapeHtml from @maple/strings in the markdown renderer #2447 moved escapeHtml out of escape.ts and #2430 added markdown.ts importing it from there. Each passed alone; together main fails typecheck, lint and the web build, which blocks the production deploy. * fix(chat-platform): keep the page block's comment vendor-neutral vendor-isolation.test.ts scans this package for chat vendor names, comments included, and the comment added in #2454 named one.
Stacked on #2446. Part of the audit stack that starts at #2434.
Bugs fixed
putnow sweeps expired entries once the map has doubled. A non-finite TTL, which never expired, is no longer stored.fetchwould not.lib/safe-fetchre-sent the same method and body on a 301, 302 or 303. It now follows the fetch standard: 303 turns anything but GET or HEAD into a body-less GET, 301 and 302 do so for POST, and 307 and 308 keep method and body. Behaviour change: an alert webhook that answers a POST with 301, 302 or 303 is now followed with a GET.test-sloplint plugin skipped chained test modifiers.it.effect.each(rows)(...)orit.live.only(...)was not recognised as a test, so the weak-assertion rule never ran inside it. No test file uses a chained modifier today, so nothing new is reported.Cleanup
escapeHtmlandtruncatehad copies in the email, status page and chat platform packages. They live inlib/stringsnow.Checked, no change
dayLabelgoing into attributes unescaped. It is already escaped at its only HTML call site and is built from dates, counts and fixed words; titles reach the page only as script-safe JSON written withtextContent.Verification
Left for a decision
clampSizeinlib/grid-enginecan push a tile past the right edge when a stored tile is narrower than itsminW. The obvious fix breaks nine golden fixtures and a property test that deliberately letsminWwin, anddocs/dashboard-grid.mdnames that parity as a rule. Not changed.authorization,cookieandproxy-authorizationare stripped. Changing that could break scrape targets that rely on it.effect-strictlint rules are implemented twice, and the committedanti-slop.mjsbundle has no drift check.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.