Skip to content

Convert GetOptions to Source #826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 27, 2018
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
4 changes: 4 additions & 0 deletions Firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Unreleased
- [changed] Added ability to control whether DocumentReference.getDocument() and
Query.getDocuments() should fetch from server only, cache only, or attempt
server and fall back to the cache (which was the only option previously, and
is now the default.)

# v0.10.0
- [changed] Removed the includeMetadataChanges property in FIRDocumentListenOptions
Expand Down
8 changes: 4 additions & 4 deletions Firestore/Example/Firestore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; };
61CC13FA2007D0C90021F5BF /* FIRGetOptionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CC13F82007D0C20021F5BF /* FIRGetOptionsTests.m */; };
61287373203C92C5000EAD3F /* FIRSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 61287372203C92C5000EAD3F /* FIRSourceTests.m */; };
61E1D8B11FCF6C5700753285 /* StringViewTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 61E1D8AF1FCF6AF500753285 /* StringViewTests.mm */; };
6ED54761B845349D43DB6B78 /* Pods_Firestore_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75A6FE51C1A02DF38F62FAAD /* Pods_Firestore_Example.framework */; };
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -236,7 +236,7 @@
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
61CC13F82007D0C20021F5BF /* FIRGetOptionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRGetOptionsTests.m; sourceTree = "<group>"; };
61287372203C92C5000EAD3F /* FIRSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRSourceTests.m; sourceTree = "<group>"; };
61E1D8AF1FCF6AF500753285 /* StringViewTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringViewTests.mm; sourceTree = "<group>"; };
69F6A10DBD6187489481CD76 /* Pods_Firestore_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Firestore_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -725,7 +725,7 @@
DE51B1BC1F0D48AC0013853F /* API */ = {
isa = PBXGroup;
children = (
61CC13F82007D0C20021F5BF /* FIRGetOptionsTests.m */,
61287372203C92C5000EAD3F /* FIRSourceTests.m */,
DE51B1BD1F0D48AC0013853F /* FIRCursorTests.m */,
DE51B1BE1F0D48AC0013853F /* FIRDatabaseTests.m */,
DE51B1BF1F0D48AC0013853F /* FIRFieldsTests.m */,
Expand Down Expand Up @@ -1274,6 +1274,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
61287373203C92C5000EAD3F /* FIRSourceTests.m in Sources */,
DE03B2EE1F214BAA00A30B9C /* FIRWriteBatchTests.m in Sources */,
DE03B2F01F214BAA00A30B9C /* FIRDatabaseTests.m in Sources */,
5491BC731FB44593008B3588 /* FSTIntegrationTestCase.mm in Sources */,
Expand All @@ -1284,7 +1285,6 @@
54E928251F33953400C1953E /* FSTEventAccumulator.m in Sources */,
DE03B2ED1F214BA200A30B9C /* FSTSmokeTests.m in Sources */,
DE03B2F31F214BAA00A30B9C /* FIRQueryTests.m in Sources */,
61CC13FA2007D0C90021F5BF /* FIRGetOptionsTests.m in Sources */,
DE03B35E1F21586C00A30B9C /* FSTHelpers.m in Sources */,
DE03B2F51F214BAA00A30B9C /* FIRTypeTests.m in Sources */,
DE03B2EF1F214BAA00A30B9C /* FIRCursorTests.m in Sources */,
Expand Down
16 changes: 6 additions & 10 deletions Firestore/Example/SwiftBuildTest/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ func readDocument(at docRef: DocumentReference) {
}

func readDocumentWithOptions(at docRef: DocumentReference) {
docRef.getDocument(options:GetOptions.defaultOptions()) { document, error in
docRef.getDocument(source:Source.default) { document, error in
}
docRef.getDocument(options:GetOptions.source(GetSource.default)) { document, error in
docRef.getDocument(source:.server) { document, error in
}
docRef.getDocument(options:GetOptions.source(.server)) { document, error in
}
docRef.getDocument(options:GetOptions.source(GetSource.cache)) { document, error in
docRef.getDocument(source:Source.cache) { document, error in
}
}

Expand All @@ -247,13 +245,11 @@ func readDocuments(matching query: Query) {
}

func readDocumentsWithOptions(matching query: Query) {
query.getDocuments(options:GetOptions.defaultOptions()) { querySnapshot, error in
}
query.getDocuments(options:GetOptions.source(GetSource.default)) { querySnapshot, error in
query.getDocuments(source:Source.default) { querySnapshot, error in
}
query.getDocuments(options:GetOptions.source(.server)) { querySnapshot, error in
query.getDocuments(source:.server) { querySnapshot, error in
}
query.getDocuments(options:GetOptions.source(GetSource.cache)) { querySnapshot, error in
query.getDocuments(source:Source.cache) { querySnapshot, error in
}
}

Expand Down
Loading