Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit the need for MainActor for DefaultMessages #83

Open
umair-ably opened this issue Oct 13, 2024 · 0 comments
Open

Revisit the need for MainActor for DefaultMessages #83

umair-ably opened this issue Oct 13, 2024 · 0 comments

Comments

@umair-ably
Copy link
Collaborator

umair-ably commented Oct 13, 2024

Whilst I don't think this is wrong per-say, I'm not confident it is necessary.

My rationale here... given DefaultMessages is very close to the UI layer e.g. getting messages, it's not "wrong" for MainActor to be required here, however that's not why this was done.

I got an error message - Incorrect actor executor assumption of which there doesn't seem to be much resources on the internet about. This wasn't an issue prior to Swift 6 so it seems relatively new. Trial and error lead me to trying @MainActor and this worked.

Equally, I require subscriptionPoints to be mutable - without @MainActor, I get Stored property 'subscriptionPoints' of 'Sendable'-conforming class 'DefaultMessages' is mutable.

Creating this issue as a investigation task to revisit once we have:

  1. More functionality implemented as part of chat-swift
  2. More knowledge of Swift Concurrency

┆Issue is synchronized with this Jira Task by Unito

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

No branches or pull requests

1 participant