Skip to content

Prevent reentrant address-book Details dialogs - #1027

Merged
Stephen Griffin (stephenegriffin) merged 1 commit into
mainfrom
investigate/280-address-book-dialog-hang
Oct 21, 2026
Merged

Stephen Griffin (stephenegriffin) merged 1 commit into
mainfrom
investigate/280-address-book-dialog-hang

Conversation

@stephenegriffin

Copy link
Copy Markdown
Member

Summary

Prevent the address-book Details closing-order hang by allowing only one active IAddrBook::Details call per UI thread.

Fixes #280.

  • Add a shared, exception-safe guard used by address-book Display Details, EntryID options, and QueryIdentity.
  • Reject reentrant requests with a localized message asking the user to close the existing Details dialog. Multi-selection stops after one warning; other application windows remain usable.
  • Preserve DIALOG_MODAL, provider arguments, the calling UI thread, and existing cancellation/error behavior.
  • Add eight provider-independent native regressions to the existing unit-test project.

This is an intentional one-active-Details restriction, not a change to Outlook provider internals. Direct-provider and actual-handler controls reproduced the original hang when closing nested Details dialogs out of order.

Validation

  • Debug x64 and x86 builds pass.
  • Eight new tests pass on both x64 and x86.
  • clang-format 17 and git diff --check pass.
  • Live x64 Outlook MAPI tests pass with initialization flags 0 and 1: all three UI paths reject reentry, multi-selection warns once, the actual warning dialogs display and dismiss normally, and later Details requests succeed after the original closes. These tests used read-only address-book access, without mailbox/profile writes.

Measured native coverage

Compared the same Debug x64 test DLL with the new tests excluded (280/280 passing) and included (288/288 passing). SHA-256 checks verified the DLL was restored unchanged after collection.

Scope Before After
Details helper lines 0/8 8/8 (100%)
Helper, RAII cleanup, and error-wrapper blocks 0/46 46/46 (100%)
Unique linked production-core lines exercised 5,382/6,398 (84.12%) 5,391/6,398 (84.26%)

Net gain: nine unique production-core lines, +0.1407 percentage points, with no previously executed core lines lost. Coverage is for core code linked into the native test DLL, not repository-wide/UI-handler coverage or exhaustive path coverage.

Route all three Details entry points through a shared per-thread guard. Report reentry once, preserve modal provider arguments and cancellation behavior, and add eight provider-independent regressions.

Fixes #280

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Test Results

    8 files  ± 0      8 suites  ±0   51s ⏱️ -2s
  288 tests + 8    288 ✅ + 8  0 💤 ±0  0 ❌ ±0 
2 304 runs  +64  2 304 ✅ +64  0 💤 ±0  0 ❌ ±0 

Results for commit cf0e98e. ± Comparison against base commit 44e68ec.

@stephenegriffin
Stephen Griffin (stephenegriffin) merged commit 463cc00 into main Oct 21, 2026
21 checks passed
@stephenegriffin
Stephen Griffin (stephenegriffin) deleted the investigate/280-address-book-dialog-hang branch October 21, 2026 21:03
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.

Multiple addressbook details dialogs hang when closing in different order

3 participants