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

move all work to main thread with serial executor #225

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

ndurell
Copy link
Contributor

@ndurell ndurell commented Oct 18, 2024

Description

This backports some stuff from the new test store from TCA.
This should move all store tests effects to the main thread.

Check List

  • Are you changing anything with the public API?
  • Have you tested this change on real device?
  • Are your changes backwards compatible with previous SDK Versions?
  • Have you added unit test coverage for your changes?
  • Have you verified that your changes are compatible with all the operating system version this SDK currently supports?

Manual Test Plan

Supporting Materials

@ndurell ndurell requested a review from a team as a code owner October 18, 2024 13:46
@@ -1241,13 +1262,13 @@ extension TestStore where ScopedState: Equatable, Action: Equatable {
/// expected.
@MainActor
@_disfavoredOverload
func receive(
func receive(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm will fix this

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: for consistency, could we re-indent whole file with 4 spaces instead of 2? Select all (Command-A), then re-indent (Control-i)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yah I thought we had that set somewhere in the linting but maybe never enforced anything...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That might make the diff hard to read.

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh good point

if uncheckedUseMainSerialExecutor {
await Task.yield()
} else {
await self.reducer.effectDidSubscribe.stream.first(where: { _ in true })
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is different in TCA - might backport that change too..

@@ -1241,13 +1262,13 @@ extension TestStore where ScopedState: Equatable, Action: Equatable {
/// expected.
@MainActor
@_disfavoredOverload
func receive(
func receive(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: for consistency, could we re-indent whole file with 4 spaces instead of 2? Select all (Command-A), then re-indent (Control-i)

This was referenced Oct 18, 2024
@ndurell ndurell merged commit 15e3d96 into master Oct 18, 2024
14 checks passed
@ndurell ndurell deleted the noah/useSerialExecutor branch October 18, 2024 15:33
@ab1470 ab1470 mentioned this pull request Oct 18, 2024
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