Make spam example test deterministic

This commit is contained in:
ericz committed 2026-11-08 14:30:20 +01:00
1 parent a020eb30d0
commit cc12e2eb96
2 files changed
+16 -5

No files matched your search

@@ -107,6 +107,14 @@ class MessageFilterService extends ChangeNotifier {
@visibleForTesting
int get recentCleanCount => _recentClean.length;
@visibleForTesting
bool hasRecentCleanExample(String text) {
final key = MessageFilterText.normalize(text);
return _recentClean.any(
(example) => MessageFilterText.normalize(example.text) == key,
);
}
/// Loads persisted state and trains the classifier.
Future<void> load() async {
try {