Skip to content

COR-173 - Interrupt IMAP command on cancel - #101

Closed
dbezverkhnii wants to merge 2 commits into
spark2from
feature/COR-173-interrupt-imap-command-on-cancel
Closed

COR-173 - Interrupt IMAP command on cancel#101
dbezverkhnii wants to merge 2 commits into
spark2from
feature/COR-173-interrupt-imap-command-on-cancel

Conversation

@dbezverkhnii

@dbezverkhnii dbezverkhnii commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Note

High Risk
Changes live IMAP async teardown (stream cancel leaves the session unusable until reconnect) and shifts Windows C++ delivery to digest-named release assets—missing or mismatched prebuilts will block Spark Windows builds until someone publishes on Windows.

Overview
Adds interruptCurrentCommand() so a running IMAP operation can abort its blocked socket read (via mailstream_cancel) instead of waiting on the timeout—wired through OperationQueue’s running-op tracking, IMAPSession, C/Swift bindings, and Darwin unit tests with a silent TCP stub.

Separately replaces the numbered S3 Windows prebuilt flow with content-addressed mailcore2-windows-<digest>.zip assets on the windows-prebuilt GitHub release: new windows-build-pins.json, shared PowerShell (Prebuilt-Common.ps1, Publish-Mailcore2Prebuilt.ps1, Check-PrebuiltPublished.ps1, Build-Helpers.ps1), updated Get-Mailcore2.ps1 / Build-Mailcore2.ps1, a PR check job that verifies the merge-result digest has a published archive, plus README and AGENTS.md for the manual publish path.

Reviewed by Cursor Bugbot for commit 5e3105d. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5e3105d. Configure here.

Comment thread build-windows-5.10/Publish-Mailcore2Prebuilt.ps1
$windowsSdkBin = "C:\Program Files (x86)\Windows Kits\10\bin\$($toolchain.windowsSdk)\x64"
$cmakeBin = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin"
$ninjaBin = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja"
$env:Path = "$swiftBin;$msvcBin;$windowsSdkBin;$cmakeBin;$ninjaBin;$env:Path"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Toolchain ignores pinned Swift version

Medium Severity

Initialize-Toolchain puts the first clang-cl.exe under Programs\Swift\Toolchains on PATH, not the version in windows-build-pins.json. The publish preflight only checks that the pinned platform exists. A machine with more than one Swift can compile the archive with a different toolchain than the digest claims.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5e3105d. Configure here.

@dbezverkhnii
dbezverkhnii deleted the feature/COR-173-interrupt-imap-command-on-cancel branch September 1, 2026 14:18
dbezverkhnii added a commit that referenced this pull request Sep 1, 2026
mailcore2-windows-0a7de371ed29.zip, already on the release, carries an
MCIMAPAsyncConnection.h from the COR-180 branch: it declares setReserved,
isReserved, setAutomaticDisconnectDelay and automaticDisconnectDelay, none of
which are in the mailcore2.dll beside it. It is the only one of the 132 shipped
headers that public-headers.cmake does not declare.

src/CMakeLists.txt stages the public headers into the CMake binary directory
with file(COPY) and installs that directory whole. file(COPY) adds but never
prunes, so the header stayed behind from a build of another branch and was
packaged. Publish cleaned the install tree and the staging copy but not the
build directory, so:

- the build directory is now cleaned too, which is what actually stops it;
- the archive check no longer requires MCIMAPAsyncConnection.h. That line came
  over from COR-180 with the release-assets work, but this branch does not make
  the header public and spark2 never did - so the check was passing only by
  finding the stale copy. It now requires MailCore.h, which
  public-headers.cmake has always declared.

The digest does not cover the publish script, so the archive keeps its name:
re-publish 0a7de371ed29 with -Force to replace the contaminated one.

Reported by Cursor Bugbot on the closed PR #101; the header it named there was
the C one, which this branch does not have.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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