Skip to content
Open
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
8 changes: 0 additions & 8 deletions Firestore/Example/Firestore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@
128F2B032E254E2C0006327E /* QueryToPipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128F2B002E254E2C0006327E /* QueryToPipelineTests.swift */; };
1290FA77A922B76503AE407C /* lru_garbage_collector_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 277EAACC4DD7C21332E8496A /* lru_garbage_collector_test.cc */; };
1291D9F5300AFACD1FBD262D /* array_sorted_map_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 54EB764C202277B30088B8F3 /* array_sorted_map_test.cc */; };
1296CECE2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */; };
1296CECF2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */; };
1296CED02DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */; };
129A369A28CA555B005AE7E2 /* FIRCountTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 129A369928CA555B005AE7E2 /* FIRCountTests.mm */; };
129A369B28CA555B005AE7E2 /* FIRCountTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 129A369928CA555B005AE7E2 /* FIRCountTests.mm */; };
129A369C28CA555B005AE7E2 /* FIRCountTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 129A369928CA555B005AE7E2 /* FIRCountTests.mm */; };
Expand Down Expand Up @@ -1920,7 +1917,6 @@
1235769422B86E65007DDFA9 /* FirestoreEncoderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FirestoreEncoderTests.swift; sourceTree = "<group>"; };
124C932B22C1642C00CA8C2D /* CodableIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableIntegrationTests.swift; sourceTree = "<group>"; };
128F2B002E254E2C0006327E /* QueryToPipelineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QueryToPipelineTests.swift; sourceTree = "<group>"; };
1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealtimePipelineTests.swift; sourceTree = "<group>"; };
129A369928CA555B005AE7E2 /* FIRCountTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FIRCountTests.mm; sourceTree = "<group>"; };
12F4357299652983A615F886 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
132E32997D781B896672D30A /* reference_set_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reference_set_test.cc; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2503,7 +2499,6 @@
861684E49DAC993D153E60D0 /* PipelineTests.swift */,
621D620928F9CE7400D2FA26 /* QueryIntegrationTests.swift */,
128F2B002E254E2C0006327E /* QueryToPipelineTests.swift */,
1296CECD2DEE97EF007F8552 /* RealtimePipelineTests.swift */,
4D65F6E69993611D47DC8E7C /* SnapshotListenerSourceTests.swift */,
EFF22EA92C5060A4009A369B /* VectorIntegrationTests.swift */,
);
Expand Down Expand Up @@ -4983,7 +4978,6 @@
655F8647F57E5F2155DFF7B5 /* PipelineTests.swift in Sources */,
621D620C28F9CE7400D2FA26 /* QueryIntegrationTests.swift in Sources */,
128F2B022E254E2C0006327E /* QueryToPipelineTests.swift in Sources */,
1296CECF2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */,
1CFBD4563960D8A20C4679A3 /* SnapshotListenerSourceTests.swift in Sources */,
EE4C4BE7F93366AE6368EE02 /* TestHelper.swift in Sources */,
EFF22EAC2C5060A4009A369B /* VectorIntegrationTests.swift in Sources */,
Expand Down Expand Up @@ -5265,7 +5259,6 @@
C8C2B945D84DD98391145F3F /* PipelineTests.swift in Sources */,
621D620B28F9CE7400D2FA26 /* QueryIntegrationTests.swift in Sources */,
128F2B032E254E2C0006327E /* QueryToPipelineTests.swift in Sources */,
1296CECE2DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */,
A0BC30D482B0ABD1A3A24CDC /* SnapshotListenerSourceTests.swift in Sources */,
A78366DBE0BFDE42474A728A /* TestHelper.swift in Sources */,
EFF22EAB2C5060A4009A369B /* VectorIntegrationTests.swift in Sources */,
Expand Down Expand Up @@ -5829,7 +5822,6 @@
E04CB0D580980748D5DC453F /* PipelineTests.swift in Sources */,
621D620A28F9CE7400D2FA26 /* QueryIntegrationTests.swift in Sources */,
128F2B012E254E2C0006327E /* QueryToPipelineTests.swift in Sources */,
1296CED02DEE97F5007F8552 /* RealtimePipelineTests.swift in Sources */,
B00F8D1819EE20C45B660940 /* SnapshotListenerSourceTests.swift in Sources */,
AD34726BFD3461FF64BBD56D /* TestHelper.swift in Sources */,
EFF22EAA2C5060A4009A369B /* VectorIntegrationTests.swift in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion Firestore/Example/Tests/Integration/API/FIRAggregateTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,9 @@ - (void)testCannotPerformMoreThanMaxAggregations {
[self awaitExpectation:expectation];

XCTAssertNotNil(result);
XCTAssertTrue([[result localizedDescription] containsString:@"maximum number of aggregations"]);
if (!FSTIntegrationTestCase.isRunningAgainstEmulator) {
XCTAssertTrue([[result localizedDescription] containsString:@"maximum number of aggregations"]);
}
}

- (void)testThrowsAnErrorWhenGettingTheResultOfAnUnrequestedAggregation {
Expand Down
2 changes: 1 addition & 1 deletion Firestore/Swift/Source/SwiftAPI/Firestore+Pipeline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Foundation
}

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
@nonobjc func realtimePipeline() -> PipelineSource<RealtimePipeline> {
@nonobjc internal func realtimePipeline() -> PipelineSource<RealtimePipeline> {
return PipelineSource<RealtimePipeline>(db: self) { stages, db in
RealtimePipeline(stages: stages, db: db)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import Foundation

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
public struct PipelineListenOptions: Sendable, Equatable, Hashable {
struct PipelineListenOptions: Sendable, Equatable, Hashable {
// MARK: - Stored Properties

/// The desired behavior for handling pending server timestamps.
Expand Down Expand Up @@ -68,7 +68,7 @@ public struct PipelineListenOptions: Sendable, Equatable, Hashable {
}

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
public struct RealtimePipeline: @unchecked Sendable {
struct RealtimePipeline: @unchecked Sendable {
private var stages: [Stage]

let bridge: RealtimePipelineBridge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import Foundation

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
public struct RealtimePipelineSnapshot: Sendable {
struct RealtimePipelineSnapshot: Sendable {
/// The Pipeline on which `execute()` was called to obtain this `PipelineSnapshot`.
public let pipeline: RealtimePipeline

Expand Down Expand Up @@ -51,7 +51,7 @@ public struct RealtimePipelineSnapshot: Sendable {
}

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
public struct PipelineResultChange: Sendable {
struct PipelineResultChange: Sendable {
public enum ChangeType {
case added, modified, removed
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class AggregationIntegrationTests: FSTIntegrationTestCase {
XCTFail("Error expected.")
} catch let error as NSError {
XCTAssertNotNil(error)
XCTAssertTrue(error.localizedDescription.contains("maximum number of aggregations"))
if !AggregationIntegrationTests.isRunningAgainstEmulator() {
XCTAssertTrue(error.localizedDescription.contains("maximum number of aggregations"))
}
}
}

Expand Down
38 changes: 0 additions & 38 deletions Firestore/Swift/Tests/Integration/QueryIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -332,41 +332,3 @@ class QueryIntegrationTests: FSTIntegrationTestCase {
)
}
}

class QueryAsPipelineIntegrationTests: QueryIntegrationTests {
override class var isRunningPipeline: Bool {
return true
}

override func check(_ coll: CollectionReference, query: Query,
matchesResult expectedKeys: [String]) async throws {
let collPipeline = coll.firestore.realtimePipeline().create(from: coll)
var collIterator = collPipeline.snapshotStream().makeAsyncIterator()
var _ = try await collIterator.next()

let pipeline = query.firestore.realtimePipeline().create(from: query)

var cacheIterator = pipeline.snapshotStream(options: .init(source: .cache)).makeAsyncIterator()
let cacheSnapshot = try await cacheIterator.next()
let cacheResultIds = cacheSnapshot?.results().map { $0.id }

var serverIterator = pipeline.snapshotStream(options: .init(
includeMetadataChanges: true,
source: .default
)).makeAsyncIterator()
var serverSnapshot = try await serverIterator.next()
if serverSnapshot?.metadata.isFromCache == true {
serverSnapshot = try await serverIterator.next()
}
let serverResultIds = serverSnapshot?.results().map { $0.id }

var remoteKeysIterator = pipeline.snapshotStream(options: .init(source: .cache))
.makeAsyncIterator()
let remoteKeysSnapshot = try await remoteKeysIterator.next()
let remoteKeysResultIds = remoteKeysSnapshot?.results().map { $0.id }

XCTAssertEqual(cacheResultIds, serverResultIds)
XCTAssertEqual(serverResultIds, remoteKeysResultIds)
XCTAssertEqual(remoteKeysResultIds, expectedKeys)
}
}
Loading