Skip to content

fix(meeting): cancel queued model preparation promptly - #1099

Open
kirolos-esmat wants to merge 2 commits into
altic-dev:mainfrom
kirolos-esmat:codex/fix-meeting-preparation-cancellation
Open

kirolos-esmat wants to merge 2 commits into
altic-dev:mainfrom
kirolos-esmat:codex/fix-meeting-preparation-cancellation

Conversation

@kirolos-esmat

@kirolos-esmat kirolos-esmat commented Oct 10, 2026 •

Copy link
Copy Markdown

Description

Cancelling a meeting-model preparation queued behind another preparation currently waits for the predecessor to finish. Replace the task chain with a cancellation-aware FIFO waiter queue so the cancelled caller returns promptly without running its preparation or allowing concurrent cache writes.

Type of Change

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Fixes #1098.

Testing

FluidVoice v1.6.10-beta.8 (7daffb5), macOS 27.0.1, Apple Silicon arm64.

Reproduction: hold the first queue operation on a gate, start and cancel a second preparation, and require cancellation before releasing the gate. The initial regression reproduced the failure on unchanged upstream and passed with this fix. The revised test now confirms actual queue admission before cancellation rather than relying on a delay. Existing cases also verify serialized execution and recovery after failure/cancellation. Admission is observed through a read-only Debug-only queue count; Release behavior is unchanged.

For the initial reproduction, the same upstream actor and three queue XCTest cases were isolated in a temporary Swift package for before/after comparison:

Before: cancellation expectation timed out after 2 seconds.
Executed 3 tests, with 1 failure.
After: Executed 3 tests, with 0 failures.
  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 27.0.1
  • Ran linter locally: strict SwiftLint on the two changed Swift files, no violations.
  • Ran formatter locally
  • Ran tests locally: three queue tests, before/after comparison and the focused Xcode test target.

Follow-up validation: the revised three queue tests passed through Xcode. Disabling cancelWaiter in a temporary copy caused the queued-cancellation expectation to time out, proving the revised test detects a broken cancellation path. Strict lint and code/test/documentation guard reviews passed.

Focused Xcode check:

xcodebuild test -project Fluid.xcodeproj -scheme Fluid -configuration Debug \
  -destination 'platform=macOS,arch=arm64' \
  -only-testing:FluidDictationIntegrationTests/MeetingModelPreparationQueueTests \
  CODE_SIGN_IDENTITY=- DEVELOPMENT_TEAM= CODE_SIGN_STYLE=Manual

The full suite was not rerun on this isolated branch. The cancellation timing was reproduced at the queue boundary, not through the meeting UI.

Screenshots / Video

Before/after captured XCTest output

This image renders excerpts from the initial before/after test logs; it is not a live app UI screenshot. Copyable output and reproduction steps are included above.

Notes

Codex assisted with the fix, regression test, and submission preparation. I reviewed and approved the complete local diff before submission. This PR contains only the meeting preparation cancellation fix, its regression test, and diagnostic evidence.

  • A human reviewed and approved this change before submission and takes responsibility for it.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T14:36:45.893548Z 40ac1e2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous test issue is fixed and no new blocking issues were found.

Summary

The PR replaces chained preparation tasks with a cancellation-aware queue. Preparations still run one at a time.

  • Cancelled meeting preparations return while earlier loads are running.

Reviews (2) · Last reviewed commit: "test(meeting): confirm queue admission b..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d05719537

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
await fulfillment(of: [active], timeout: 2)
let second = Task {
waiting.fulfill()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Synchronize cancellation with actual queue admission

Under a loaded XCTest scheduler, waiting.fulfill() can wake the test before this task has entered queue.run and been added to the waiters array; the later 20 ms sleep is only a timing guess. If second.cancel() wins that race, the parent implementation also returns immediately from its leading cancellation check, so this regression test passes without exercising cancellation of an actually queued preparation. Signal actual admission from the queue (for example through a test hook) before cancelling.

Useful? React with 👍 / 👎.

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.

[BUG] Cancelled queued meeting preparation waits for the active preparation

1 participant