Skip to content

Don't quit or replace the annotations after an incomplete export - #236

Merged
mfl28 merged 1 commit into
masterfrom
fix/keep-app-open-after-failed-export
Oct 13, 2026
Merged

mfl28 merged 1 commit into
masterfrom
fix/keep-app-open-after-failed-export

Conversation

@mfl28

@mfl28 mfl28 commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Quitting, opening another folder, and an import that replaces the current annotations all offer to save first. After that export, the action ran even if some files couldn't be written: the error report appeared, and the app quit (or replaced the annotations) right after, so the annotations that weren't saved were lost.

Now

  • Quitting, opening another folder, an import that replaces the annotations (saveWithFormatChoiceAndRunOnSaveSuccess): these run only once everything was saved. After an incomplete export, the error report is shown, the annotations stay unsaved (red status dot), and the user can export again.
  • Reloading a folder that changed on disk (saveWithFormatChoiceAndRunInAnyCase): still runs in any case, because the folder has already changed. AnnotationIoController marks these operations with a small RunInAnyCase wrapper, which onExportFinished checks.

Tests (AnnotationIoControllerTest)

  • An export with errors doesn't run an operation that waits for a successful save, but runs one that runs in any case.
  • The existing test for the "in any case" variant now checks that the wrapped operation runs.
  • All 23 tests in the class pass locally. The UI tests run in CI.

Quitting, opening another folder and an import that replaces the
annotations wait for the export the user chose to save first. They ran
even if some files couldn't be written, which discarded those
annotations. Now they only run once everything was saved; otherwise the
error report is shown, the annotations stay unsaved and the user can
export again. Reloading a folder that changed on disk still runs in any
case.
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.50%. Comparing base (921087f) to head (be91c37).

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #236   +/-   ##
=========================================
  Coverage     90.49%   90.50%           
- Complexity     2408     2410    +2     
=========================================
  Files           142      142           
  Lines          9019     9023    +4     
  Branches        862      862           
=========================================
+ Hits           8162     8166    +4     
  Misses          445      445           
  Partials        412      412           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mfl28
mfl28 merged commit cc6a384 into master Oct 13, 2026
19 checks passed
@mfl28
mfl28 deleted the fix/keep-app-open-after-failed-export branch October 13, 2026 04:56
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.

1 participant