Skip to content

fix: diff view failed on edge cases#59

Merged
sirily11 merged 1 commit into
mainfrom
rxcode/diffview-edge-tests
May 26, 2026
Merged

fix: diff view failed on edge cases#59
sirily11 merged 1 commit into
mainfrom
rxcode/diffview-edge-tests

Conversation

@sirily11

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 26, 2026 03:27
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxcode Ready Ready Preview, Comment May 26, 2026 4:13am

Request Review

@autopilot-project-manager autopilot-project-manager Bot added the bug Something isn't working label May 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.buildThreadEditDiff helper with hunk fallback when the snapshot pair collapses; FileDiffView adopts it and the legacy disk fallback now also requires real +/- lines before short-circuiting.
  • Parallel withTaskGroup fan-out for broadcastToAllClients, fanoutPush, and fanoutAPNs, plus offline-peer skipping in broadcastMobileSnapshots.
  • New unit tests in DiffComputationTests covering snapshot-pair collapse for large deletes and new-file writes, missing modifiedContent, 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.

@sirily11 sirily11 force-pushed the rxcode/diffview-edge-tests branch from b95d48e to 64e14f7 Compare May 26, 2026 04:13
@sirily11 sirily11 enabled auto-merge (squash) May 26, 2026 04:13
@sirily11 sirily11 merged commit a161d8a into main May 26, 2026
11 checks passed
@sirily11 sirily11 deleted the rxcode/diffview-edge-tests branch May 26, 2026 04:25
@sirily11

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants