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

Fix: Crash when writing to user defaults in background thread #3285

Merged

Conversation

larryonoff
Copy link
Contributor

Potential fix for the issue #3247

@stephencelis
Copy link
Member

@larryonoff Can you add a test that would have failed/crashed before the fix?

@larryonoff
Copy link
Contributor Author

larryonoff commented Aug 15, 2024

@larryonoff Can you add a test that would have failed/crashed before the fix?

@stephencelis Just updated the tests, failed - before the fix, success - now. Previously, the tests only covered updates from publisher (that handled in the main thread), leaving out perception updates.

@larryonoff
Copy link
Contributor Author

@mbrandonw BTW I assume that test part that checks publisher may be deleted. SwiftUI doesn't subscribe to publisher, it uses perception.

@mbrandonw mbrandonw merged commit 833792e into pointfreeco:main Aug 15, 2024
6 checks passed
@larryonoff larryonoff deleted the fix/crash-writing-defaults-background branch August 15, 2024 17:00
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Sep 15, 2024
…ure to from: "1.13.1" (#1210)

This PR contains the following updates:

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

---

### Release Notes

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

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

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

#### What's Changed

- Fixed: Address regression in which `observe` was limited to platforms
that can import UIKit by bringing back an AppKit-compatible version
([https://github.com/pointfreeco/swift-composable-architecture/pull/3295](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3295)).
- Infrastructure: Integration test fixes
([https://github.com/pointfreeco/swift-composable-architecture/pull/3294](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3294)).

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.13.0...1.13.1

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

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

#### What's Changed

- Added: UIKit navigation and binding tools
([https://github.com/pointfreeco/swift-composable-architecture/pull/3180](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3180)).
- Fixed: Update `Shared` to invoke `reportIssue`
([https://github.com/pointfreeco/swift-composable-architecture/pull/3258](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3258)).
- Fixed: Address a few compiler warnings
([https://github.com/pointfreeco/swift-composable-architecture/pull/3279](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3279)).
- Fixed: Avoid crash when writing to shared user defaults on a
background thread (thanks
[@&#8203;larryonoff](https://togithub.com/larryonoff),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3285](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3285)).
- Infrastructure: Typo fixes (thanks
[@&#8203;hmhv](https://togithub.com/hmhv),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3267](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3267);
[@&#8203;mltbnz](https://togithub.com/mltbnz),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3268](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3268)).
- Infrastructure: Update swiftlang repository link (thanks
[@&#8203;lamtrinhdev](https://togithub.com/lamtrinhdev),
[https://github.com/pointfreeco/swift-composable-architecture/pull/3270](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3270)).
- Infrastructure: Updated a bunch of DocC references
([https://github.com/pointfreeco/swift-composable-architecture/pull/3287](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3287)).

#### New Contributors

- [@&#8203;mltbnz](https://togithub.com/mltbnz) made their first
contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/3268](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3268)
- [@&#8203;lamtrinhdev](https://togithub.com/lamtrinhdev) made their
first contribution in
[https://github.com/pointfreeco/swift-composable-architecture/pull/3270](https://togithub.com/pointfreeco/swift-composable-architecture/pull/3270)

**Full Changelog**:
pointfreeco/swift-composable-architecture@1.12.1...1.13.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:eyJjcmVhdGVkSW5WZXIiOiIzOC41NS4wIiwidXBkYXRlZEluVmVyIjoiMzguNTUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: cgrindel-self-hosted-renovate[bot] <139595543+cgrindel-self-hosted-renovate[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.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