Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/StreamAttachments/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamCore/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamCore/Utils/Data+Gzip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extension Data {
///
/// - Returns: Gzip-compressed `Data` instance.
/// - Throws: `GzipError`
func gzipped() throws -> Data {
public func gzipped() throws -> Data {
guard !isEmpty else {
return Data()
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/StreamCore/Utils/HTTPUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Foundation

extension URLRequest {
var queryItems: [URLQueryItem] {
public var queryItems: [URLQueryItem] {
if let url,
let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false),
let queryItems = urlComponents.queryItems {
Expand All @@ -16,7 +16,7 @@ extension URLRequest {
}

extension Array where Element == URLQueryItem {
var prettyPrinted: String {
public var prettyPrinted: String {
var message = ""

forEach { item in
Expand Down
6 changes: 3 additions & 3 deletions Sources/StreamCore/Utils/RawJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public indirect enum RawJSON: Codable, Hashable, Sendable {
case array([RawJSON])
case `nil`

static let double = number
public static let double = number

public init(from decoder: Decoder) throws {
let singleValueContainer = try decoder.singleValueContainer()
Expand Down Expand Up @@ -294,7 +294,7 @@ extension RawJSON {
/// let price = customData["flight"]?["price"].numberValue
/// let destination = customData["flight"]?["destination"].stringValue
/// ```
subscript(key: String) -> RawJSON? {
public subscript(key: String) -> RawJSON? {
get {
guard case let .dictionary(dict) = self else {
return nil
Expand All @@ -320,7 +320,7 @@ extension RawJSON {
/// let customData = message.customData
/// let secondFlightPrice = customData["flights"]?[1]?["price"] ?? 0
/// ```
subscript(index: Int) -> RawJSON? {
public subscript(index: Int) -> RawJSON? {
get {
guard case let .array(array) = self else {
return nil
Expand Down
22 changes: 0 additions & 22 deletions Sources/StreamCore/Utils/StreamRuntimeCheck.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,4 @@ public enum StreamRuntimeCheck {
///
/// When set to false, a message will be logged on console, but the assertion will not be thrown.
public nonisolated(unsafe) static var assertionsEnabled = false

/// For *internal use* only
///
/// Established the maximum depth of relationships to fetch when performing a mapping
///
/// Eg.
/// Relationship: Message ---> QuotedMessage ---> QuotedMessage ---X--- NIL
/// Relationship: Channel ---> Message ---> QuotedMessage ---X--- NIL
/// Depth: 0 1 2 3
nonisolated(unsafe) static var _backgroundMappingRelationshipsMaxDepth = 2

/// For *internal use* only
///
/// Returns true if the maximum depth of relationships to fetch when performing a mapping is not yet met
static func _canFetchRelationship(currentDepth: Int) -> Bool {
currentDepth <= _backgroundMappingRelationshipsMaxDepth
}

/// For *internal use* only
///
/// Core Data prefetches data used for creating immutable model objects (faulting is disabled).
public nonisolated(unsafe) static var _isDatabasePrefetchingEnabled = false
}
2 changes: 1 addition & 1 deletion Sources/StreamCore/Utils/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extension String {
}

extension StringProtocol {
func ranges<S: StringProtocol>(of string: S, options: String.CompareOptions = []) -> [Range<String.Index>] {
public func ranges<S: StringProtocol>(of string: S, options: String.CompareOptions = []) -> [Range<String.Index>] {
var result: [Range<Index>] = []
var startIndex = startIndex
while startIndex < endIndex, let range = self[startIndex...].range(of: string, options: options) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamCore/Utils/SystemEnvironment+Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import Foundation

enum SystemEnvironment {
/// A Stream Core version.
public static let version: String = "0.4.0"
public static let version: String = "0.4.1"
}
5 changes: 5 additions & 0 deletions Sources/StreamCore/Utils/Timers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public protocol TimerControl {
}

extension DispatchWorkItem: TimerControl {}
extension DispatchWorkItem: @retroactive @unchecked Sendable {}

/// Default real-world implementations of timers.
public struct DefaultTimer: StreamTimer {
Expand Down Expand Up @@ -116,7 +117,11 @@ private class RepeatingTimer: RepeatingTimerControl, @unchecked Sendable {

private let queue = DispatchQueue(label: "io.getstream.repeating-timer")
private var state: State = .suspended
#if compiler(>=6.1)
private let timer: DispatchSourceTimer
#else
private nonisolated(unsafe) let timer: DispatchSourceTimer
#endif

init(timeInterval: TimeInterval, queue: DispatchQueue, onFire: @escaping () -> Void) {
timer = DispatchSource.makeTimerSource(queue: queue)
Expand Down
2 changes: 1 addition & 1 deletion Sources/StreamCoreUI/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<string>0.4.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
Loading