Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

NEUTRINO render cache: cache hits don't refresh age; stale work-* folders never cleaned

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start with pruneRenders and neutrinoWav in src/singer/neutrino.ts, then read the existing pruneRenders tests. Check how cache hits are handled and how render work directories are named and cleaned up. Add tests for refreshing a cached WAV's mtime and removing stale work-* folders while keeping fresh ones; done means both behaviors pass.

Written by the indexing model from the issue text.

Description

Follow-up from the review of #42. pruneRenders (src/singer/neutrino.ts) trims ~/.cache/jinglescript/neutrino-renders/ before each uncached NEUTRINO render. It has two gaps.

1. Cache hits don't refresh a render's age, so the most-used renders are dropped.
neutrinoWav returns a cached WAV with readFileSync, which leaves its mtime unchanged. pruneRenders sorts and expires by mtime, so "oldest" means "created longest ago", not "used longest ago". A render used every day is still deleted after 30 days, or as soon as 200 newer ones exist, and the next render runs NEUTRINO again (tens of seconds).
Fix: on a cache hit, touch the file (utimesSync(file, now, now)) so the 30-day / 200-file limits act as least-recently-used.

2. Leftover work-* folders are never cleaned up.
Each render works in neutrino-renders/work-XXXX/ and removes it in finally. If the process is killed or crashes mid-render, or NEUTRINO_KEEP_WORK=1 was set, the folder stays. pruneRenders only looks at *.wav, so these folders (labels, f0, mel, wav: several MB each) build up forever. One was left in my own cache after the review.
Fix: also remove work-* directories older than some age (e.g. 1 day, so a render running in another process isn't touched).

Tests: extend the pruneRenders tests with a hit that refreshes the mtime, and a stale work-* folder that gets removed while a fresh one is kept.

Dominant language
TypeScript
Stars
3
Forks
0
Avg merge
2h 17m
Merged PRs (30d)
39

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from receptron/jinglescript

All issues in receptron/jinglescript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.