fix: diff view failed on edge cases#59
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
The PR fixes diff-view edge cases where a snapshot capture race produced originalContent == modifiedContent, causing the desktop "full file" diff to render as "No changes" even though the sidebar showed +N/-N from hunks. It introduces a shared DiffComputation.buildThreadEditDiff helper that prefers the snapshot-pair diff when it contains real +/- lines and otherwise falls back to the recorded hunks. It also includes unrelated MobileSync fan-out concurrency improvements (parallel relay broadcast and parallel APNs/FCM push) and skips .offline peers in broadcastMobileSnapshots.
Changes:
- New
DiffComputation.buildThreadEditDiffhelper with hunk fallback when the snapshot pair collapses;FileDiffViewadopts it and the legacy disk fallback now also requires real+/-lines before short-circuiting. - Parallel
withTaskGroupfan-out forbroadcastToAllClients,fanoutPush, andfanoutAPNs, plus offline-peer skipping inbroadcastMobileSnapshots. - New unit tests in
DiffComputationTestscovering snapshot-pair collapse for large deletes and new-file writes, missingmodifiedContent, and the no-data case.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Packages/Sources/DiffView/DiffComputation.swift | Adds buildThreadEditDiff that prefers snapshot diff but falls back to hunks when no real +/- lines exist. |
| Packages/Sources/RxCodeChatKit/FileDiffView.swift | Uses the new helper for snapshot-pair rendering and gates the legacy disk fallback on having real changes. |
| Packages/Tests/DiffViewTests/DiffComputationTests.swift | Adds tests for snapshot-pair collapse, new-file write collapse, preference of differing pair, missing modified content, and empty inputs. |
| RxCode/Services/MobileSyncService.swift | Parallelizes relay broadcast and APNs/FCM push fan-out via withTaskGroup. |
| RxCode/App/AppState+MobileSnapshots.swift | Skips peers in .offline state when broadcasting mobile snapshots. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b95d48e to
64e14f7
Compare
|
🎉 This PR is included in version 1.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.