fixed client-reported crashes in the pdf viewer, image picker and prosemirror images, mapped webdav errors to user messages and hardened keychain, cache and push stores against io failures

This commit is contained in:
MineTec committed 2026-10-12 17:00:14 +02:00
1 parent c5592f117b
commit 23e4510bf8
19 files changed
+545 -55

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:marianum_mobile/storage/keychain_write.dart';
void main() {
group('isKeychainDuplicateItem', () {
test('recognises the OSStatus in the details', () {
final e = PlatformException(
code: 'Unexpected security result code',
message:
'Code: -25299, Message: The specified item already exists in the keychain.',
details: -25299,
);
expect(isKeychainDuplicateItem(e), isTrue);
});
test('falls back to the message when details are missing', () {
final e = PlatformException(
code: 'Unexpected security result code',
message: 'Code: -25299, Message: duplicate',
);
expect(isKeychainDuplicateItem(e), isTrue);
});
test('ignores other keychain errors and non-platform errors', () {
final e = PlatformException(
code: 'Unexpected security result code',
message: 'Code: -25308, Message: interaction not allowed',
details: -25308,
);
expect(isKeychainDuplicateItem(e), isFalse);
expect(isKeychainDuplicateItem(StateError('x')), isFalse);
});
});
}