Skip to content

feat(clean): add Brave Service Worker and Stremio cache cleanup#673

Open
sebastianbreguel wants to merge 2 commits intotw93:mainfrom
sebastianbreguel:feat/brave-stremio-cache
Open

feat(clean): add Brave Service Worker and Stremio cache cleanup#673
sebastianbreguel wants to merge 2 commits intotw93:mainfrom
sebastianbreguel:feat/brave-stremio-cache

Conversation

@sebastianbreguel
Copy link
Copy Markdown
Contributor

@sebastianbreguel sebastianbreguel commented Apr 2, 2026

Summary

Two additions to `mo clean` app-specific cache cleanup, bundled per the preference stated in #643.

1. Brave Service Worker cleanup

Brave already has cache, GPU, shader, and old-version cleanup in `mo clean`. This adds the missing Service Worker cleanup — Chrome has it, Brave shares the same Chromium directory structure but was missing it.

Iterates all Brave profiles under `~/Library/Application Support/BraveSoftware/Brave-Browser/` and cleans:

  • `Service Worker/CacheStorage` (via `clean_service_worker_cache`, respects protected domains)
  • `Service Worker/ScriptCache/*`

2. Stremio cache cleanup

Adds two paths to `clean_video_players()` in `mo clean`:

  • `~/Library/Caches/smart.stremio*/*`
  • `~/Library/Application Support/stremio/stremio-server/stremio-cache/*`

Visual preview

  → Brave Service Worker, would clean 630MB, 0 protected
  → Brave Service Worker ScriptCache 217 items, 49.1MB dry
  ✓ Stremio cache, 120MB
  ✓ Stremio server cache, 2.4GB

What changed

File Change
`lib/clean/user.sh` Service Worker loop for Brave profiles, after Dawn cache cleanup
`lib/clean/app_caches.sh` 2 new `safe_clean` lines in `clean_video_players()`
`tests/clean_user_core.bats` Test: Brave SW cleanup labels appear in `mo clean` output
`tests/clean_app_caches.bats` Test: Stremio labels appear in `clean_video_players` output

Test plan

  • `bats tests/clean_user_core.bats tests/clean_app_caches.bats` — 42/42 pass
  • `mo clean --dry-run` — Brave Service Worker and ScriptCache appear correctly
  • Stremio lines skipped cleanly when Stremio is not installed
  • No regressions in existing browser/media cleanup tests

Closes #643

Add Service Worker cache cleanup for Brave browser, mirroring the
existing Chrome cleanup pattern. Brave profiles are scanned for
CacheStorage and ScriptCache under Service Worker/.

Add Stremio cache cleanup to clean_video_players:
- ~/Library/Caches/smart.stremio*/*
- ~/Library/Application Support/stremio/stremio-server/stremio-cache/*

Closes tw93#643
@sebastianbreguel sebastianbreguel requested a review from tw93 as a code owner April 2, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add stremio-service cache cleanup step

1 participant