Skip to content

Conversation

mbrandonw
Copy link
Member

Prior to the ReducerProtocol we would queue print changes in the debug operator on reducers:

We lost that in #1283, but we still used fireAndForget which had a sync overload, and so queuing just naturally happened on the main thread.

But, with 1.0 we got rid of fireAndForget and so instead used run, but then that introduced asynchrony and possible ordering issues with logs. So, currently it is possible for actionA to be sent before actionB, yet the logs for actionB will appear in the console before actionA.

This PR brings back the queue. Alternatively we could @MainActor the run effect. Each approach has their pros and cons. With the queue we run the risk of the logs starting to lag if too much is logged at once, and with @MainActor we risk slowing down the app if too much is logged (only in debug). I went with the queue for now, but open to switch to @MainActor too.

@davdroman
Copy link

@MainActor making the app lag sounds significantly worse than just the logs themselves lagging, from a DX perspective.

@mbrandonw mbrandonw merged commit bd6c1fc into main Oct 15, 2023
@mbrandonw mbrandonw deleted the queue-logging branch October 15, 2023 15:31
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Oct 25, 2023
…ure to from: "1.3.0" (#689)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[pointfreeco/swift-composable-architecture](https://togithub.com/pointfreeco/swift-composable-architecture)
| minor | `from: "1.2.0"` -> `from: "1.3.0"` |

---

### Release Notes

<details>
<summary>pointfreeco/swift-composable-architecture
(pointfreeco/swift-composable-architecture)</summary>

###
[`v1.3.0`](https://togithub.com/pointfreeco/swift-composable-architecture/releases/tag/1.3.0)

[Compare
Source](https://togithub.com/pointfreeco/swift-composable-architecture/compare/1.2.0...1.3.0)

#### What's Changed

- Added: `dismiss(transaction:)` dependency (thanks
[@&#8203;tomokisun](https://togithub.com/tomokisun),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2433](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2433)).
- Fixed: `Reducer.ifLet` child effects are now properly cancelled when
reset by a parent
([https://github.com/pointfreeco/swift-composable-architecture/pull/2402](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2402)).
- Fixed: Added missing `file` and `line` parameters to `dismiss`
dependency (thanks [@&#8203;heiberg](https://togithub.com/heiberg),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2440](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2440)).
- Fixed: Only dismiss alert/dialog state when receiving a
domain-specific action
([https://github.com/pointfreeco/swift-composable-architecture/pull/2468](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2468)).
- Fixed: Serialize `Reducer._printChanges()`
([https://github.com/pointfreeco/swift-composable-architecture/pull/2519](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2519)).
- Infrastructure: README, tutorial, and other assorted fixes (thanks
[@&#8203;zooxop](https://togithub.com/zooxop),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2405](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2405);
thanks [@&#8203;filblue](https://togithub.com/filblue),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2418](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2418),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2467](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2467),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2486](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2486);
thanks [@&#8203;yimajo](https://togithub.com/yimajo),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2425](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2425),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2426](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2426);
thanks [@&#8203;denil-ct](https://togithub.com/denil-ct),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2427](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2427);
thanks [@&#8203;mornin-ystIUBqR](https://togithub.com/mornin-ystIUBqR),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2446](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2446);
thanks [@&#8203;jkimdev](https://togithub.com/jkimdev),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2454](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2454);
thanks [@&#8203;Jager-yoo](https://togithub.com/Jager-yoo),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2442](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2442);
[https://github.com/pointfreeco/swift-composable-architecture/pull/2472](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2472);
thanks [@&#8203;vasiliyzaycev](https://togithub.com/vasiliyzaycev),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2474](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2474),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2475](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2475);
thanks [@&#8203;jtouzy](https://togithub.com/jtouzy) in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2477](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2477);
thanks [@&#8203;jaesung-0o0](https://togithub.com/jaesung-0o0),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2484](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2484),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2499](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2499);
thanks [@&#8203;ictechgy](https://togithub.com/ictechgy),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2481](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2481);
thanks [@&#8203;Ryu0118](https://togithub.com/Ryu0118),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2482](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2482);
[https://github.com/pointfreeco/swift-composable-architecture/pull/2480](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2480);
thanks [@&#8203;KyleLeneau](https://togithub.com/KyleLeneau),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2493](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2493);
thanks [@&#8203;kalupas226](https://togithub.com/kalupas226),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2498](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2498);
thanks [@&#8203;kodok1988](https://togithub.com/kodok1988),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2511](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2511)).
- Infrastructure: Rename Standups sample project to SyncUps
([https://github.com/pointfreeco/swift-composable-architecture/pull/2524](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2524));
remove meeting feature reducer
([https://github.com/pointfreeco/swift-composable-architecture/pull/2410](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2410));
fixed `.minutes` duration (thanks
[@&#8203;filblue](https://togithub.com/filblue),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2437](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2437)).
- Infrastructure: Bump `actions/checkout` version to `v4` (thanks
[@&#8203;Ryu0118](https://togithub.com/Ryu0118),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2479](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2479)).
- Infrastructure: Clean up `StoreTask.cancel` implementation (thanks
[@&#8203;Ryu0118](https://togithub.com/Ryu0118),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2496](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2496)).
- Infrastructure: Revamp integration tests
([https://github.com/pointfreeco/swift-composable-architecture/pull/2503](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2503),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2515](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2515)).
- Infrastructure: Simplify SwiftUI case studies
([https://github.com/pointfreeco/swift-composable-architecture/pull/2526](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2526)).
- Infrastructure: Fixed search example debounce duration (thanks
[@&#8203;wtsnz](https://togithub.com/wtsnz),
[https://github.com/pointfreeco/swift-composable-architecture/pull/2525](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2525)).

#### New Contributors

- [@&#8203;zooxop](https://togithub.com/zooxop) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2405](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2405)
- [@&#8203;denil-ct](https://togithub.com/denil-ct) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2427](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2427)
- [@&#8203;tomokisun](https://togithub.com/tomokisun) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2433](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2433)
- [@&#8203;mornin-ystIUBqR](https://togithub.com/mornin-ystIUBqR) made
their first contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2446](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2446)
- [@&#8203;jkimdev](https://togithub.com/jkimdev) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2454](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2454)
- [@&#8203;vasiliyzaycev](https://togithub.com/vasiliyzaycev) made their
first contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2474](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2474)
- [@&#8203;jtouzy](https://togithub.com/jtouzy) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2477](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2477)
- [@&#8203;ictechgy](https://togithub.com/ictechgy) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2481](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2481)
- [@&#8203;KyleLeneau](https://togithub.com/KyleLeneau) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2493](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2493)
- [@&#8203;kodok1988](https://togithub.com/kodok1988) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2511](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2511)
- [@&#8203;wtsnz](https://togithub.com/wtsnz) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/2525](https://togithub.com/pointfreeco/swift-composable-architecture/pull/2525)

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.2.0...1.3.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDAuMCIsInVwZGF0ZWRJblZlciI6IjM2LjEwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
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.

3 participants