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
Gwendal Roué
45539583a8
Mutex.wasNeeded convenience
2024-07-27 16:37:33 +02:00
Gwendal Roué
87b9db65d1
StrictConcurrency: ValueConcurrentObserver is Sendable
...
Required for DatabaseCancellable conformance
2024-07-27 16:37:33 +02:00
Gwendal Roué
5465d056ab
StrictConcurrency: refactor ValueReducer and extract its Sendable fetching facet
2024-07-27 16:37:33 +02:00
Gwendal Roué
ff2a75489d
StrictConcurrency: ValueWriteOnlyObserver is Sendable
...
Required for DatabaseCancellable conformance
2024-07-27 16:37:33 +02:00
Gwendal Roué
b4677dede4
StrictConcurrency: DatabaseRegionConvertible is Sendable
...
A ValueObservation will use such an object from database readers, writers, and the main thread: they must support all isolation domains.
2024-07-27 16:37:33 +02:00
Gwendal Roué
8f486a5e41
StrictConcurrency: fix warning about AnyDatabaseCancellable initializer
2024-07-27 16:37:33 +02:00
Gwendal Roué
484224c654
StrictConcurrency: fix warning about Inflections.default
2024-07-27 16:37:33 +02:00
Gwendal Roué
7f5205ef8c
Rename ReadWriteBox to ReadWriteLock
...
... and make it conditionally Sendable, and it is no longer a property wrapper.
It is conditionally Sendable because we can't use the techniques of the future standard Mutex (SE-0433 Synchronous Mutual Exclusion Lock, https://github.com/apple/swift-evolution/blob/main/proposals/0433-mutex.md ).
It is no longer a property wrapper because the Swift compiler can perform strict concurrency checks through a `var` property.
2024-07-27 16:37:33 +02:00
Gwendal Roué
99715892e7
StrictConcurrency: fix warning about StatementArgumentsSink.literalValues
2024-07-27 16:37:33 +02:00
Gwendal Roué
e022c35b49
StrictConcurrency: OrderedDictionary is conditionally Sendable
2024-07-27 16:37:33 +02:00
Gwendal Roué
5a2c15b82e
StrictConcurrency: DatabasePromise initializer requires a Sendable value
2024-07-27 16:37:33 +02:00
Gwendal Roué
88539df543
StrictConcurrency: use a Sendable strong reference
2024-07-27 16:37:33 +02:00