Skip to content

Auto-sync solution when exercise diff has no files#8493

Merged
dem4ron merged 2 commits into
mainfrom
fix/8456
Feb 11, 2026
Merged

Auto-sync solution when exercise diff has no files#8493
dem4ron merged 2 commits into
mainfrom
fix/8456

Conversation

@iHiD
Copy link
Copy Markdown
Member

@iHiD iHiD commented Feb 9, 2026

Closes #8456

Summary

  • When the diff endpoint finds no interesting file changes between a solution's git SHA and the exercise's current SHA, auto-sync the solution to the latest exercise version instead of returning a 400 error
  • Remove the Sentry error report for empty diffs (eliminates noise from RuntimeError: No files were found during solution diff)
  • Add frontend handling for empty files case: show an "Exercise Updated" notice instead of crashing on diff.files[0].relativePath

Context

The out_of_date? check (hash-based) and the actual git diff (content-based) can disagree — the hash changed but no interesting files actually changed. When this happens, the best action is to silently sync the solution since there are no meaningful changes for the user to review.

Test plan

  • Controller tests pass (bundle exec rails test test/controllers/api/solutions_controller_test.rb)
  • JS tests pass (yarn test)
  • Verified new test covers auto-sync behavior on empty diff
  • Manual: verify that when a solution has an empty diff, the modal shows the auto-updated notice and page reloads

🤖 Generated with Claude Code

When a solution's git_important_files_hash differs from the exercise's
but the actual git diff produces no interesting file changes, auto-sync
the solution to the latest exercise version instead of returning a 400
error and reporting to Sentry. The frontend now gracefully handles the
empty files case with an auto-updated notice.

Closes #8456

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dem4ron dem4ron marked this pull request as ready for review February 11, 2026 15:39
@dem4ron dem4ron self-requested a review as a code owner February 11, 2026 15:39
@dem4ron dem4ron merged commit 6d6c3cd into main Feb 11, 2026
40 checks passed
@dem4ron dem4ron deleted the fix/8456 branch February 11, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RuntimeError: No files were found during solution diff (RuntimeError)

2 participants