Skip to content

Fix interleaved subscription operations#52369

Merged
maxbrunsfeld merged 2 commits intomainfrom
fix-interleaved-subcsription-operations
Mar 25, 2026
Merged

Fix interleaved subscription operations#52369
maxbrunsfeld merged 2 commits intomainfrom
fix-interleaved-subcsription-operations

Conversation

@mikayla-maki
Copy link
Copy Markdown
Member

@mikayla-maki mikayla-maki commented Mar 25, 2026

Context

Since #52232, there have been a lot of problems related to panels randomly hiding and showing themselves. However, the code in that PR is pretty innocuous. It shouldn't be having that kind of effect. However, it turns out there's a bug in how GPUI subscriptions work that caused there to be orphaned observe callbacks firing spuriously. The core sequence is captured in test_unsubscribe_during_callback_with_insert, essentially you have to have two observers on the same item (SettingsStore, in this case), that both drop themselves. If the first observer adds a callback onto the same item, then the second observer will never successfully drop itself.

While in there, I also fixed an unrelated bug that @maxbrunsfeld noticed where if you have two callbacks on the same item, and an earlier callback drops a later one, then the second callback will spuriously fire.

I also added a few extra smoke tests to the subscription code, and a test capturing the observed bug at the workspace level.

Self-Review Checklist

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 25, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Mar 25, 2026
@mikayla-maki mikayla-maki force-pushed the fix-interleaved-subcsription-operations branch from 7d8ea05 to 0640b7a Compare March 25, 2026 01:14
@mikayla-maki mikayla-maki marked this pull request as ready for review March 25, 2026 01:14
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team and cole-miller and removed request for a team March 25, 2026 01:14
@mikayla-maki mikayla-maki changed the title Fix interleaved subcsription operations Fix interleaved subscription operations Mar 25, 2026
@maxbrunsfeld maxbrunsfeld merged commit 06fabec into main Mar 25, 2026
32 checks passed
@maxbrunsfeld maxbrunsfeld deleted the fix-interleaved-subcsription-operations branch March 25, 2026 05:54
Copy link
Copy Markdown
Collaborator

@maxbrunsfeld maxbrunsfeld left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for figuring this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants