Skip to content

Fix draft refresh race blocking release - #24

Merged
mrinc merged 1 commit into
masterfrom
fix/draft-refresh-deletion-race
Sep 13, 2026
Merged

mrinc merged 1 commit into
masterfrom
fix/draft-refresh-deletion-race

Conversation

@bcbetterninja

Copy link
Copy Markdown
Collaborator

The v0.2.62 release was blocked on Windows by DraftQuickDeletionDoesNotWaitForOtherDraftsToSync: a draft snapshot read before deletion could finish afterward and restore a deleted draft to the visible list.

Version draft refresh requests and invalidate in-flight snapshots after committing quick deletion. Only a current snapshot can replace Drafts/Outbox. The regression explicitly delivers an older snapshot after deleting both drafts while provider deletion remains blocked, and verifies that it is rejected.

Validation: Release build succeeds with zero warnings/errors; all 522 tests pass locally. The failed v0.2.62 tag is unchanged and no release was published. A release containing this fix must use a new tag after merge.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d6e3d226-6367-47d7-b4a4-dae336b00e75


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mrinc
mrinc merged commit f8a5841 into master Sep 13, 2026
8 checks passed
@mrinc
mrinc deleted the fix/draft-refresh-deletion-race branch September 13, 2026 20:46

@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: 2d22db321c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (current is null || current.IsQueued) return;
await _store.QueueDraftDeletionAsync(current);
// A refresh started before this commit must not resurrect its stale snapshot.
Interlocked.Increment(ref _draftRefreshVersion);

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 Refresh collections after invalidating a pending snapshot

When quick deletion overlaps another draft operation—such as the background reconciliation started during initialization or a composer save—this increment can invalidate that operation's already-read post-change snapshot. RefreshDraftsAsync then returns without applying anything, while DeleteDraftQuickAsync removes only its own draft; if the subsequent sync is blocked processing the remote deletion, unrelated imported/saved drafts or outbox changes remain invisible until a later refresh. Apply a fresh post-deletion snapshot or otherwise preserve the unrelated changes instead of only invalidating the pending refresh.

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.

2 participants