diff --git a/lib/services/storage_service.dart b/lib/services/storage_service.dart index 0c78c592..9ec8dac3 100644 --- a/lib/services/storage_service.dart +++ b/lib/services/storage_service.dart @@ -5,7 +5,6 @@ import '../storage/prefs_manager.dart'; class StorageService { static const String _pathHistoryPrefix = 'path_history_'; - static const String _pendingMessagesKey = 'pending_messages'; static const String _repeaterPasswordsKey = 'repeater_passwords'; static const String _repeaterAutoClockSyncAfterLoginKey = 'repeater_auto_clock_sync_after_login'; @@ -86,31 +85,6 @@ class StorageService { } } - Future> loadPendingMessages() async { - final prefs = PrefsManager.instance; - final jsonStr = prefs.getString(_pendingMessagesKey); - - if (jsonStr == null) return {}; - - try { - final json = jsonDecode(jsonStr) as Map; - return json.map((key, value) => MapEntry(key, value as String)); - } catch (e) { - return {}; - } - } - - Future savePendingMessages(Map pending) async { - final prefs = PrefsManager.instance; - final jsonStr = jsonEncode(pending); - await prefs.setString(_pendingMessagesKey, jsonStr); - } - - Future clearPendingMessages() async { - final prefs = PrefsManager.instance; - await prefs.remove(_pendingMessagesKey); - } - /// Save a repeater password by public key hex Future saveRepeaterPassword( String repeaterPubKeyHex, diff --git a/lib/storage/scoping_inventory.dart b/lib/storage/scoping_inventory.dart index b1cff4ae..740c687d 100644 --- a/lib/storage/scoping_inventory.dart +++ b/lib/storage/scoping_inventory.dart @@ -190,17 +190,12 @@ const List storageSurfaces = [ 'which is why it was never reported', owner: 'lib/services/storage_service.dart', ), - StorageSurface( - 'pending_messages', - verdict: ScopingVerdict.knownHole, - issue: 855, - reason: - 'global, but DEAD: loadPendingMessages, savePendingMessages and ' - 'clearPendingMessages have no callers anywhere in lib/ or test/, and ' - 'the key is absent from the owner\'s live prefs. The fix is deletion, ' - 'not scoping', - owner: 'lib/services/storage_service.dart', - ), + // `pending_messages` (#855) was listed here and is GONE, not reclassified. + // It had no callers anywhere in lib/ or test/ and the key was absent from + // the owner's live prefs, so the fix was deletion rather than scoping. The + // inventory's "declared but vanished from source" check is what keeps that + // honest in the other direction: if the key ever comes back, the gate fails + // until somebody declares it and says why. // --------------------------------------------------------------------------- // Global on purpose. The reason is the point: it stops a later audit diff --git a/test/services/radio_isolation_bleed_test.dart b/test/services/radio_isolation_bleed_test.dart index 080a10a4..02e346ff 100644 --- a/test/services/radio_isolation_bleed_test.dart +++ b/test/services/radio_isolation_bleed_test.dart @@ -157,18 +157,12 @@ void main() { }); }); - group('#855 pending messages', () { - test('the API round-trips but nothing in the app calls it ' - '(Epic B deletes it)', () async { - // Kept deliberately small: the finding is that this API has no - // callers in lib/ or test/, which a unit test cannot assert. It is - // recorded in scoping_inventory.dart and proved by grep. This test - // only pins that the thing being deleted currently works, so the - // deletion is removal of dead code rather than of a live feature. - final storage = StorageService(); - await storage.savePendingMessages({'a': 'b'}); - - expect(await storage.loadPendingMessages(), {'a': 'b'}); - }); - }); + // #855's round-trip test was here and is gone with the API it pinned (B1). + // Its job was to prove the thing being deleted actually worked, so the + // deletion was provably removal of dead code and not of a live feature. It + // served that purpose and then became a test of nothing. + // + // What still guards the deletion: the inventory's "declared but vanished + // from source" check, which fails if `pending_messages` ever returns + // undeclared. } diff --git a/test/storage/scoping_inventory_test.dart b/test/storage/scoping_inventory_test.dart index 0d923eee..ee3e3476 100644 --- a/test/storage/scoping_inventory_test.dart +++ b/test/storage/scoping_inventory_test.dart @@ -67,14 +67,19 @@ void main() { ); }); - test('the known holes are exactly the ones Epic B fixes', () { + test('the known holes are exactly the ones Epic B has left to fix', () { // Pins the set. A NEW hole cannot hide among the known ones, and a hole - // fixed in Epic B cannot be left mislabelled here. + // Epic B has fixed cannot be left mislabelled here. + // + // #855 is absent on purpose: Epic B DELETED that surface rather than + // scoping it, so there is no hole left to track. This expectation + // shrinks as B1, B2 and B3 land, and reaching an empty set is what + // closing Epic B looks like. final holes = { for (final s in storageSurfaces) if (s.verdict == ScopingVerdict.knownHole) s.issue!, }; - expect(holes, {854, 855, 856}); + expect(holes, {854, 856}); }); });