• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ThePalaceProject / web-patron / 32533325761
30%

Build:
DEFAULT BRANCH: main
Ran 21 Aug 2026 10:33PM UTC
Jobs 1
Files 93
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Aug 2026 10:31PM UTC coverage: 29.623% (+0.3%) from 29.323%
32533325761

push

github

web-flow
Memoize getLibraries merge (PP-5018) (#186)

## Description

Memoize the merged library list in `getLibraries`. The merge result is
reused until a registry cache entry is written, instead of allocating a
fresh object spanning every library on each call. A version counter on
the shared registry state invalidates the memo on every cache write
(including across Next.js bundle contexts), and the memo is also keyed
on the config object reference. Because callers now share one object,
the return type is `Readonly` to enforce the no-mutation contract.
Memoization is per-process; instances behind a load balancer each keep
their own cache and memo.

## Motivation and Context

`getLibraries` runs on every page render and every `/api/libraries`
request, but its result only changes when a registry refresh writes new
data (at most once per refresh interval). With a large registry,
rebuilding the merged map per request created constant allocation and GC
pressure on the server. This addresses one of the findings from the
server-side memory investigation (PP-4959).

[Jira PP-5018]

## How Has This Been Tested?

- Manual testing in local dev environment.
- New tests verify:
- that repeated calls return the same object while the cache is
unchanged;
  - that the merge is recomputed after a refresh writes new data;
- and that a memoized result is not reused for a different config
object.
- All tests / check pass locally and [in
CI](https://github.com/ThePalaceProject/web-patron/actions/runs/32505496838).

## Checklist:

- [x] I have updated the documentation accordingly.
- [x] All new and existing tests passed.

331 of 1472 branches covered (22.49%)

Branch coverage included in aggregate %.

13 of 13 new or added lines in 1 file covered. (100.0%)

715 of 2059 relevant lines covered (34.73%)

9.53 hits per line

Jobs
ID Job ID Ran Files Coverage
1 32533325761.1 21 Aug 2026 10:33PM UTC 93
29.62
GitHub Action Run
Source Files on build 32533325761
  • Tree
  • List 93
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 5f276e87 on github
  • Prev Build on main (#32397845389)
  • Next Build on main (#32540627485)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc