fix(settings): fail closed on an unreadable lock store and make lock writes reliable

- A lock store that cannot be read is no longer treated as empty: while
  the lock is active every category is withheld (renderer predicates and
  set-based filters alike) until the PIN is entered or the store reads
  again, and writes are refused meanwhile so an empty in-memory store can
  never wipe the persisted locks. The lock set now lives in its own
  ParentalLockLockStore service.
- The M3U group dialog's lock write is awaited and a failed save is
  reported in a snackbar instead of being silently dropped.
- The Electron categories.locked re-stamp clears and re-locks inside one
  transaction, so a failed restamp keeps the previous index.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5.1 committed 2026-09-26 02:59:54 +02:00
1 parent 41bab4dcaa
commit c114cd04d3
16 files changed
+482 -143

No files matched your search

@@ -48,6 +48,22 @@ export const PARENTAL_LOCK_XTREAM_CATEGORY_TYPES: readonly ParentalLockXtreamCat
export const PARENTAL_LOCK_STALKER_CATEGORY_TYPES: readonly ParentalLockStalkerCategoryType[] =
['itv', 'vod', 'series', 'radio'];
/**
* A "withheld categories" set that withholds EVERY category. Used while the
* lock is active but the lock store could not be read: consumers keep their
* `size`/`has` checks and simply find nothing they may show.
*/
export const ALL_CATEGORIES_WITHHELD: ReadonlySet<string> = Object.freeze(
new (class extends Set<string> {
override has(): boolean {
return true;
}
override get size(): number {
return 1;
}
})()
);
export function createEmptyParentalLockPlaylistLocks(): ParentalLockPlaylistLocks {
return { xtream: [], stalker: [], m3u: [] };
}