Fix diff screen hang/crash: stable DiffLine id + request timeout; bump to 1.5
Build iOS App / Build .ipa and publish source (push) Successful in 22s

DiffLine.id was a computed property returning a fresh UUID() on every access.
SwiftUI's ForEach requires stable identities; regenerating each read churned
the main thread, hanging the diff screen and eventually crashing. Store the
UUID once per line. Also add a 30s URLRequest timeout so a hung request can't
leave the 'Loading diff...' spinner forever. Bump to 1.5.
This commit is contained in:
Hermes committed 2026-08-12 21:36:34 +00:00
1 parent 8be8f3ac50
commit db694543c1
3 files changed
+10 -5

No files matched your search

+4 -1
View File
@@ -120,7 +120,10 @@ struct DiffView: View {
private enum DiffLineType { case context, addition, deletion, hunk, meta }
private struct DiffLine: Identifiable {
// Stable id: a fresh UUID() on EVERY access (computed property) makes
// SwiftUI's ForEach re-identify on every render, churning the main thread
// and eventually crashing. Store it once.
let id: UUID = UUID()
let text: String
let type: DiffLineType
var id: UUID { UUID() }
}