mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-03 11:17:25 +00:00
fix: re-resolve AMSAT virtual types after sync; clean stale FM lists
Two independent defects kept ISS (DESTINY) visible in the satellite-page AMSAT Live FM filter even after installing the fix and syncing data: 1. UI-layer staleness (SelectionRepo): resolveTypeIds ran only when the filter type changed and snapshotted the catnum set. A background data sync rewriting the FM/Linear lists never re-triggered resolution, so the UI kept filtering with the pre-sync (dirty) set until restart or a type toggle. ISettingsRepo now exposes a monotonic amSatListsVersion StateFlow, bumped by SettingsRepo.setAmSatCatnums; SelectionRepo combines it with currentTypes so every rewrite re-resolves instantly. 2. Data-layer staleness (DatabaseRepo): when the AMSAT FM page fetch failed, the previous list was kept verbatim — including pre-whitelist era lists containing all five ISS module entries. The stale list is now re-disambiguated: previous catnums are looked up by local name and run through the same whitelist / smallest-catnum collapse, so ISS modules always collapse to the primary ZARYA (25544).
This commit is contained in:
1 parent
fa51fb2b44
commit
7401e1451b
8 files changed
+80
-22
No files matched your search
+5
@@ -89,6 +89,11 @@ interface ISettingsRepo {
|
||||
* active-transponder table (whitelist for the virtual type filters). */
|
||||
fun getAmSatActiveCatnums(): Set<Int>
|
||||
fun setAmSatActiveCatnums(catnums: Set<Int>)
|
||||
/** Monotonic version counter, incremented every time the AMSAT live
|
||||
* FM/Linear lists are rewritten. Consumers that resolve the virtual
|
||||
* types (SelectionRepo) should re-resolve on change so a background
|
||||
* data sync is reflected in the UI without a restart. */
|
||||
val amSatListsVersion: StateFlow<Int>
|
||||
//endregion
|
||||
|
||||
//region # Radio control settings
|
||||
|
||||
+1
@@ -285,6 +285,7 @@ class LoTWGridSyncTest {
|
||||
override fun updateDataSourcesStatus(status: Map<String, Int>) = TODO()
|
||||
override fun getAmSatFmCatnums(): Set<Int> = emptySet()
|
||||
override fun getAmSatLinearCatnums(): Set<Int> = emptySet()
|
||||
override val amSatListsVersion: StateFlow<Int> = MutableStateFlow(0)
|
||||
override fun setAmSatCatnums(fmCatnums: Set<Int>, linearCatnums: Set<Int>) = Unit
|
||||
override fun getAmSatActiveCatnums(): Set<Int> = emptySet()
|
||||
override fun setAmSatActiveCatnums(catnums: Set<Int>) = Unit
|
||||
|
||||
Reference in new issue
Block a user