Skip to content

Commit 386e691

Browse files
ADFA-5094: single source of truth for the catalog overlay basename
Review follow-up: BundledCatalogSource.ASSET and CatalogRepositoryImpl.BASENAME both held "kolibri_catalog.jsonl" independently, so the source (reads the overlay) and the worker (writes it) could silently drift. BASENAME now references ASSET.
1 parent e4590e5 commit 386e691

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎controller/app/src/main/java/org/iiab/controller/kolibri/data/BundledCatalogSource.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
public final class BundledCatalogSource {
4646

4747
private static final String TAG = "K2Go-Kolibri";
48-
private static final String ASSET = "kolibri_catalog.jsonl";
48+
// ADFA-5094: also the overlay basename — CatalogRepositoryImpl points the refresh worker at
49+
// this same name, so the worker writes the overlay exactly where this source looks for it.
50+
static final String ASSET = "kolibri_catalog.jsonl";
4951

5052
/** Marks the header line, so it is never mistaken for a channel. */
5153
private static final String HEADER_KEY = "catalog";

‎controller/app/src/main/java/org/iiab/controller/kolibri/data/CatalogRepositoryImpl.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public final class CatalogRepositoryImpl implements CatalogRepository {
3333
private static final String CATALOG = "kolibri";
3434
private static final String MANIFEST_URL =
3535
"https://k2go-download.appdevforall.org/catalogs/kolibri.manifest.json";
36-
private static final String BASENAME = "kolibri_catalog.jsonl";
36+
// Single source of truth for the basename: the same name BundledCatalogSource reads the overlay
37+
// from, so the worker writes it exactly where the source looks (they must never drift).
38+
private static final String BASENAME = BundledCatalogSource.ASSET;
3739

3840
private final BundledCatalogSource bundled;
3941
private final StudioTreeSource studio;

0 commit comments

Comments
 (0)