Skip to content

Conversation

@dfsm
Copy link
Contributor

@dfsm dfsm commented Oct 3, 2025

Let's start with this. If this gets accepted then I can build on top of it with the subsequent branches

I added a line to Common.xcconfig because without it my TestFlight builds were being pushed with errors I wasn't replicating in debug builds:
SWIFT_STRICT_CONCURRENCY = minimal

@dfsm dfsm requested a review from nolanw October 3, 2025 11:24
Copy link
Member

@nolanw nolanw left a comment

Choose a reason for hiding this comment

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

sorry for the delay in review, thank you very much for breaking that big pr up. let me know if you need a hand with the context.perform thing! everything else looks ok to me

func updateLastUsedDate(for smilie: Smilie) {
guard let context = dataStore.managedObjectContext else { return }
guard let context = dataStore.managedObjectContext,
let smilieText = smilie.text else { return }
Copy link
Member

Choose a reason for hiding this comment

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

see it's funny because this is exactly wrong: we should not be pawing at managed properties outside a context.perform[AndWait]. is there any way to avoid the compiler error while only accessing smilie.text within the context.perform block?

Copy link
Member

Choose a reason for hiding this comment

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

maybe the compiler can be placated by awaiting context.perform? which I guess means either introducing a Task here or marking this method async, kinda annoying.

private var jumpToPostIDAfterLoading: String?
private var messageViewController: MessageComposeViewController?
private var networkOperation: Task<(posts: [Post], firstUnreadPost: Int?, advertisementHTML: String), Error>?
private var networkOperation: Any?
Copy link
Member

Choose a reason for hiding this comment

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

yeesh

Copy link
Member

Choose a reason for hiding this comment

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

aha!


/// A slightly more convenient NSManagedObject for entities with a custom class.
public class AwfulManagedObject: NSManagedObject {
public class AwfulManagedObject: NSManagedObject, @unchecked Sendable {
Copy link
Member

Choose a reason for hiding this comment

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

should probably ditch this subclass tbh. but ok for now

…objects across concurrency boundaries in updateLastUsedDate(). Access managed object properties only within context.perform block.

- PostsPageViewController: Add comment explaining why networkOperation uses Any? type (Task returns non-Sendable Core Data objects; Swift 6 requires Sendable Success types).
@nolanw nolanw merged commit 54858e1 into main Oct 18, 2025
1 check failed
@nolanw nolanw deleted the xcode26 branch October 18, 2025 22:32
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