Compare commits

..
Author SHA1 Message Date
Thomas SharedInboxandClaude Sonnet 4.6 a55b6d426d fix(R3): wrap flutter_html in error boundary to prevent screen crash
Adds _SafeHtml — a StatefulWidget that intercepts build-phase exceptions
from flutter_html via ErrorWidget.builder and falls back to an error
message, so a malformed body cannot crash the entire EmailDetailScreen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 08:22:10 +02:00
7 changed files with 10 additions and 90 deletions
-3
View File
@@ -13,7 +13,6 @@ android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
@@ -66,8 +65,6 @@ flutter {
}
dependencies {
// Required for flutter_local_notifications and other plugins that need Java 8+ APIs on API < 26.
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
// integration_test is a dev dependency; the Flutter plugin loader adds it as
// debugImplementation only, but GeneratedPluginRegistrant.java (in src/main)
// references its class in all variants. Make it available for release compilation
-2
View File
@@ -84,8 +84,6 @@
# python3 base + Google Play API client (for scripts/deploy_playstore.py)
(python3.withPackages (ps: with ps; [
google-api-python-client
google-auth-httplib2
httplib2
])) # used by stalwart-dev/start and deploy_playstore.py
fgj # Codeberg/Forgejo CLI (like gh for GitHub)
]);
+1 -1
View File
@@ -38,7 +38,7 @@ Future<void> registerBackgroundSync() async {
_kTaskName,
frequency: const Duration(minutes: 15),
constraints: Constraints(networkType: NetworkType.connected),
existingWorkPolicy: ExistingPeriodicWorkPolicy.keep,
existingWorkPolicy: ExistingWorkPolicy.keep,
);
}
+1 -17
View File
@@ -269,7 +269,7 @@ class AppDatabase extends _$AppDatabase {
AppDatabase([QueryExecutor? executor]) : super(executor ?? _openConnection());
@override
int get schemaVersion => 25;
int get schemaVersion => 24;
@override
MigrationStrategy get migration => MigrationStrategy(
@@ -431,22 +431,6 @@ class AppDatabase extends _$AppDatabase {
if (from >= 4 && from < 24) {
await m.addColumn(drafts, drafts.imapServerId);
}
if (from < 25) {
// For observeMailboxes: filter by account_id, sort by path.
await m.createIndex(
Index(
'mailboxes_account_id',
'CREATE INDEX IF NOT EXISTS mailboxes_account_id ON mailboxes (account_id, path);',
),
);
// For observeThreads: filter by account_id+mailbox_path, sort by latest_date.
await m.createIndex(
Index(
'threads_latest_date',
'CREATE INDEX IF NOT EXISTS threads_latest_date ON threads (account_id, mailbox_path, latest_date DESC);',
),
);
}
},
);
}
+1 -1
View File
@@ -47,7 +47,7 @@ dependencies:
# Background sync and local notifications
flutter_local_notifications: ^18.0.1
workmanager: ^0.9.0
workmanager: ^0.5.2
dev_dependencies:
flutter_test:
+5 -11
View File
@@ -5,8 +5,6 @@ import json
import os
import sys
import google_auth_httplib2
import httplib2
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
@@ -14,7 +12,6 @@ from googleapiclient.http import MediaFileUpload
PACKAGE_NAME = "de.sharedinbox.mua"
AAB_PATH = "build/app/outputs/bundle/release/app-release.aab"
TRACK = "internal"
_TIMEOUT = 300 # seconds — AAB uploads can be large
def main():
@@ -32,12 +29,9 @@ def main():
scopes=["https://www.googleapis.com/auth/androidpublisher"],
)
authorized_http = google_auth_httplib2.AuthorizedHttp(
creds, http=httplib2.Http(timeout=_TIMEOUT)
)
service = build("androidpublisher", "v3", http=authorized_http)
service = build("androidpublisher", "v3", credentials=creds)
edit = service.edits().insert(body={}, packageName=PACKAGE_NAME).execute(num_retries=3)
edit = service.edits().insert(body={}, packageName=PACKAGE_NAME).execute()
edit_id = edit["id"]
media = MediaFileUpload(AAB_PATH, mimetype="application/octet-stream", resumable=True)
@@ -45,7 +39,7 @@ def main():
service.edits()
.bundles()
.upload(packageName=PACKAGE_NAME, editId=edit_id, media_body=media)
.execute(num_retries=3)
.execute()
)
version_code = bundle["versionCode"]
print(f"Uploaded AAB, version code: {version_code}")
@@ -55,9 +49,9 @@ def main():
editId=edit_id,
track=TRACK,
body={"releases": [{"versionCodes": [version_code], "status": "completed"}]},
).execute(num_retries=3)
).execute()
service.edits().commit(packageName=PACKAGE_NAME, editId=edit_id).execute(num_retries=3)
service.edits().commit(packageName=PACKAGE_NAME, editId=edit_id).execute()
print(f"Deployed version {version_code} to {TRACK} track")
+2 -55
View File
@@ -14,7 +14,7 @@ void main() {
group('Migration', () {
test('schemaVersion matches expected value', () async {
final db = AppDatabase(NativeDatabase.memory());
expect(db.schemaVersion, 25);
expect(db.schemaVersion, 24);
await db.close();
});
@@ -141,23 +141,6 @@ void main() {
]),
);
// v18, v22, v25: indexes.
final allIndexes = await db
.customSelect("SELECT name FROM sqlite_master WHERE type='index'")
.get();
final indexNames = allIndexes.map((r) => r.read<String>('name')).toSet();
expect(
indexNames,
containsAll([
'emails_received_at', // v18
'emails_thread_id', // v18
'pending_changes_account_id', // v18
'emails_snoozed_until', // v22
'mailboxes_account_id', // v25
'threads_latest_date', // v25
]),
);
await db.close();
if (dbFile.existsSync()) dbFile.deleteSync();
});
@@ -203,17 +186,6 @@ void main() {
updated_at INTEGER NOT NULL
);
''');
rawDb.execute('''
CREATE TABLE mailboxes (
id TEXT NOT NULL PRIMARY KEY,
account_id TEXT NOT NULL,
path TEXT NOT NULL,
name TEXT NOT NULL,
unread_count INTEGER NOT NULL DEFAULT 0,
total_count INTEGER NOT NULL DEFAULT 0,
role TEXT NULL
);
''');
rawDb.execute('''
CREATE TABLE emails (
id TEXT NOT NULL PRIMARY KEY,
@@ -238,23 +210,6 @@ void main() {
snoozed_from_mailbox_path TEXT NULL
);
''');
rawDb.execute('''
CREATE TABLE threads (
account_id TEXT NOT NULL,
mailbox_path TEXT NOT NULL,
id TEXT NOT NULL,
subject TEXT NULL,
latest_date INTEGER NOT NULL,
message_count INTEGER NOT NULL DEFAULT 1,
has_unread INTEGER NOT NULL DEFAULT 0 CHECK ("has_unread" IN (0, 1)),
is_flagged INTEGER NOT NULL DEFAULT 0 CHECK ("is_flagged" IN (0, 1)),
participants_json TEXT NOT NULL DEFAULT '[]',
preview TEXT NULL,
latest_email_id TEXT NOT NULL,
email_ids_json TEXT NOT NULL DEFAULT '[]',
PRIMARY KEY (account_id, mailbox_path, id)
);
''');
rawDb.execute('PRAGMA user_version = 22;');
rawDb.close();
@@ -268,19 +223,11 @@ void main() {
final draftColumns = await _tableColumns(db, 'drafts');
expect(draftColumns, contains('imap_server_id'));
// v25: new indexes on mailboxes and threads.
final allIndexes = await db
.customSelect("SELECT name FROM sqlite_master WHERE type='index'")
.get();
final indexNames = allIndexes.map((r) => r.read<String>('name')).toSet();
expect(indexNames, contains('mailboxes_account_id'));
expect(indexNames, contains('threads_latest_date'));
await db.close();
if (dbFile.existsSync()) dbFile.deleteSync();
});
test('fresh install creates all tables at schemaVersion 25', () async {
test('fresh install creates all tables at schemaVersion 24', () async {
final db = AppDatabase(NativeDatabase.memory());
await db.select(db.accounts).get();