Skip to content

EventDispatcher should be an Actor to prevent concurrent access / mutation of events.#33

Open
aswyer wants to merge 3 commits intoaptabase:mainfrom
aswyer:dequeue-error
Open

EventDispatcher should be an Actor to prevent concurrent access / mutation of events.#33
aswyer wants to merge 3 commits intoaptabase:mainfrom
aswyer:dequeue-error

Conversation

@aswyer
Copy link

@aswyer aswyer commented Oct 20, 2025

This should fix #23 and #25.

EventDispatcher flush() is called from multiple places at the same time (ex: from individual Tasks when called from stopPolling()). This results in unsafe reads / mutations of events.

Added a test to reproduce the bug that I've been experiencing and that is the same as the two linked issues.

Appreciate any thoughts on this fix!

Copy link

@bircni bircni left a comment

Choose a reason for hiding this comment

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

lgtm

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.

closure #1 in AptabaseClient.stopPolling() + 1 (AptabaseClient.swift:64)

2 participants