Commit Graph
10907 Commits
Author SHA1 Message Date
Gwendal Roué db6da72bec Xcode 15.4 recommended settings, fix ENABLE_MODULE_VERIFIER errors 2024-07-27 16:37:33 +02:00
Gwendal Roué c508729dde TODO 2024-07-27 16:37:33 +02:00
Gwendal Roué e950955b25 StrictConcurrency/tests: upgrade demo apps for strict concurrency 2024-07-27 16:37:33 +02:00
Gwendal Roué f4d9c97478 StrictConcurrency/tests: enable strict concurrency checks in other test projects 2024-07-27 16:37:33 +02:00
Gwendal Roué 0e18dae266 StrictConcurrency/tests: enable strict concurrency checks in SQLCipher tests 2024-07-27 16:37:33 +02:00
Gwendal Roué 7e2d096dca StrictConcurrency: enable strict concurrency checks in demo apps 2024-07-27 16:37:33 +02:00
Gwendal Roué c1de146a57 StrictConcurrency/tests: avoid warning about non-Sendable DispatchSpecificKey 🙄 2024-07-27 16:37:33 +02:00
Gwendal Roué a12211bc28 StrictConcurrency/tests: fix ValueObservationRecorder warnings 2024-07-27 16:37:33 +02:00
Gwendal Roué a45ba5a6e0 StrictConcurrency/tests: refactor busy handler tests 2024-07-27 16:37:33 +02:00
Gwendal Roué 3e57ce9e98 StrictConcurrency/tests: capture values instead of non-Sendable self 2024-07-27 16:37:33 +02:00
Gwendal Roué 2e10969634 StrictConcurrency/tests: introduce TestDatabaseBuilder that can connect from Sendable closures 2024-07-27 16:37:33 +02:00
Gwendal Roué afcac0102f ⚠️ EXPERIMENTAL - SE-0430 sending parameter and result values 2024-07-27 16:37:33 +02:00
Gwendal Roué bbb1a73672 StrictConcurrency/tests: use a single and Sendable test TextOutputStream 2024-07-27 16:37:33 +02:00
Gwendal Roué 5f8b39b7e6 StrictConcurrency: ValueObservation.print cautiously uses its stream argument 2024-07-27 16:37:33 +02:00
Gwendal Roué 2947b3d78b StrictConcurrency/tests: ValueObservationRecorder is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué c3dab1c2da StrictConcurrency: databaseDecodingUserInfo and databaseEncodingUserInfo must be declared as a computed property 2024-07-27 16:37:33 +02:00
Gwendal Roué 1544bd1158 StrictConcurrency: FetchableRecord.databaseDecodingUserInfo must be declared as a computed property 2024-07-27 16:37:33 +02:00
Gwendal Roué c4dfa3d2ab StrictConcurrency/tests: fix warning about mutable state 2024-07-27 16:37:33 +02:00
Gwendal Roué b06aaee438 Association is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 09182b2ad7 StrictConcurrency/tests: fix warnings about concurrently-executed functions 2024-07-27 16:37:33 +02:00
Gwendal Roué 24d232aafd StrictConcurrency: TableRecord.databaseSelection must be declared as a computed property
An alternative would have been to make SQLSelectable conform to Sendable. But this makes it harder for users to provide SQLSelectable types.
2024-07-27 16:37:33 +02:00
Gwendal Roué 1291bd7dea StrictConcurrency/tests: fix warnings about mutable state 2024-07-27 16:37:33 +02:00
Gwendal Roué cd73fdc7c3 ⚠️ Enable SE-0418
TODO: Check if this works with Xcode 15.4?
2024-07-27 16:37:33 +02:00
Gwendal Roué f175e3f384 StrictConcurrency/tests: Use a mutex for tracing allocations and deallocations 2024-07-27 16:37:33 +02:00
Gwendal Roué 45fd17028c StrictConcurrency/tests: DispatchQueue.concurrentPerform wants Sendable closures 2024-07-27 16:37:33 +02:00
Gwendal Roué e28558334f StrictConcurrency/tests: XCTestCase.waitForExpectations is main-actor isolated 2024-07-27 16:37:33 +02:00
Gwendal Roué 75f67949ea StrictConcurrency/tests: cleanup test SQL traces 2024-07-27 16:37:33 +02:00
Gwendal Roué 9e3e4158ff StrictConcurrency/tests: fix warning in CombineExpectations 2024-07-27 16:37:33 +02:00
Gwendal Roué 0f840e0413 Document TOOLCHAIN usage 2024-07-27 16:37:33 +02:00
Gwendal Roué 6536ba404f TODO 2024-07-27 16:37:33 +02:00
Gwendal Roué 5f26a7ac01 Replace Mutex.value with load() and store(_:)
... and fix logic bugs on the way.

Inspired by https://forums.swift.org/t/se-0433-synchronous-mutual-exclusion-lock/71174/58

Fixed bugs follow this pattern: https://forums.swift.org/t/se-0433-synchronous-mutual-exclusion-lock/71174/77
2024-07-27 16:37:33 +02:00
Gwendal Roué dd47a7b8b3 Extract PersistenceContainer in its own file 2024-07-27 16:37:33 +02:00
Gwendal Roué d5c0044342 StrictConcurrency: fix warning in TableRecord.request(for:) 2024-07-27 16:37:33 +02:00
Gwendal Roué 50eefa8c0f [BREAKING] PersistenceContainer is Sendable
The breaking change is that the container now only stores DatabaseValue: user can't extract the value that was previously stored.
2024-07-27 16:37:33 +02:00
Gwendal Roué c0838cf90f Improve CaseInsensitiveIdentifier documentation 2024-07-27 16:37:33 +02:00
Gwendal Roué 372affbe5b StrictConcurrency: SQLQualifiedRelation is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 91e1ca4bae Prefer Data over NSData 2024-07-27 16:37:33 +02:00
Gwendal Roué 3f61908e7e StrictConcurrency: Convert non-sendable to Sendable values before building database promises
🥳 We don't need SQLSelectable, SQLExpressible and SQLOrderingTerm to be Sendable. This is important because it allows non-Sendable types to be used in request definitions. For example: NSData, NSString (not expected to be used frequently, but users are wild).
2024-07-27 16:37:33 +02:00
Gwendal Roué 57516c5e38 StrictConcurrency: SQLAssociationCondition is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 5d66407368 StrictConcurrency: fix warning about ISO8601DateFormatter 2024-07-27 16:37:33 +02:00
Gwendal Roué 20d948b4d2 StrictConcurrency: fix warning about defaultDatabaseTableNameCache 2024-07-27 16:37:33 +02:00
Gwendal Roué 8346e69757 StrictConcurrency: ValueObservation.map requires a Sendable closure 2024-07-27 16:37:33 +02:00
Gwendal Roué 135de3c56e ⚠️ StrictConcurrency: fix warnings about the transfer of non-sendable values
We use unsafe constructs that we'll be able to replace with transferring parameters when the feature ships in the language: https://forums.swift.org/t/how-can-i-use-region-based-isolation/71426/5
2024-07-27 16:37:33 +02:00
Gwendal Roué 87fb90ef97 StrictConcurrency: FetchRequestEraser is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 6898d8c915 StrictConcurrency: AdaptedFetchRequest.adapter is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué aad170330a StrictConcurrency: SharedValueObservation is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 8b49360af1 StrictConcurrency: ValueObservation change callback is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 93f6f98261 StrictConcurrency: ValueObservation is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 67473154f9 StrictConcurrency: DatabasePublishers.ValueSubscription is Sendable 2024-07-27 16:37:33 +02:00
Gwendal Roué 8d137a2d16 StrictConcurrency: ValueObservation requires Sendable fetching closures 2024-07-27 16:37:33 +02:00