Commit Graph
36 Commits
Author SHA1 Message Date
Konstantin Varlamov 50f9df9240 Accept FIRTimestamp where NSDate is currently accepted as a parameter (#823) 2018-02-21 15:36:23 -05:00
Konstantin Varlamov 14ea068f5f Make FSTTimestamp into a public Firestore class (#698)
- FSTTimestamp is now FIRTimestamp, under Firestore/Source/{Public,API}. This is a temporary solution; eventually, FIRTimestamp is supposed to live somewhere under Firebase;
- move most internal Timestamp methods to the public header (the only exception is ISOString).
2018-02-20 17:33:57 -05:00
Michael Lehenbauer 81ee594e32 DispatchQueue delayed callback improvements + testing (#784)
Basically a port of https://github.com/firebase/firebase-js-sdk/commit/a1e346ff93c6cbcc0a1b3b33f0fbc3a7b66e7e12 and https://github.com/firebase/firebase-js-sdk/commit/fce4168309f42aa038125f39818fbf654b65b05f

* Introduces a DelayedCallback helper class in FSTDispatchQueue to encapsulate delayed callback logic.
* Adds cancellation support.
* Updates the idle timer in FSTStream to use new cancellation support.
* Adds a FSTTimerId enum for identifying delayed operations on the queue and uses it to identify our existing backoff and idle timers.
* Added containsDelayedCallback: and runDelayedCallbacksUntil: methods to FSTDispatchQueue which can be used from tests to check for the presence of a callback or to schedule them to run early.
* Removes FSTTestDispatchQueue and changes idle tests to use new test methods.
2018-02-15 16:17:44 -08:00
Gil 729b8d176c Move all Firestore Objective-C to Objective-C++ (#734)
* Move all Firestore files to Objective-C++
* Update project file references
* Don't use module imports from Objective-C++
* Use extern "C" for C-accessible globals
* Work around more stringent type checking in Objective-C++
  * NSMutableDictionary ivars aren't implicitly casted to NSDictionary
  * FSTMaybeDocument callback can't be passed a function that accepts
    FSTDocument
  * NSComparisonResult can't be multiplied by -1 without casting
* Add a #include <inttypes.h> where needed
* Avoid using C++ keywords as variables
* Remove #if __cplusplus guards
2018-01-31 11:23:55 -08:00
Michael Lehenbauer da506b86bc Fix issue @morganchen12 discovered where we weren't properly creating FIRQueryDocumentSnapshot instances. (#662) 2018-01-12 15:54:42 -08:00
rsgowman 1bafdb4ce5 Fix FSTLocalDocumentsView to allow multiple mutations while offline (#644)
* Fix FSTLocalDocumentsView to allow multiple mutations while offline.

Previously, only the last mutation would actually be visible.
2018-01-11 08:50:49 -08:00
Michael Lehenbauer dc0b29e9cf Run style.sh (#636)
Run style.sh (w/ clang-format version 6)
2018-01-10 09:28:44 -08:00
Sebastian Schmidt ed6c6f9fea Fixing potential race in ServerTimestamp tests 2018-01-05 10:34:38 -08:00
Gil 52cdf0b25a Clean up warnings (#578)
* Clean up warnings
* Remove optional parens around ifs
2017-12-18 21:05:07 -08:00
Greg Soltis 52c7329f2a Expose network management (#566)
* Expose network management in public API

* Clean up a few more references to the internal access of network management

* Move test

* Update comments

* Swap _Nullable for nullable

* Fix comment

* Add tests, including swift

* Styling
2017-12-18 18:50:08 -08:00
Michael Lehenbauer 8db0eb618d Test cleanup: Adds a helper for waiting for FSTVoidErrorBlock callbacks.
* Add helper for waiting for FSTVoidErrorBlock callbacks.
* Remove errorEventHandler from FSTEventAccumulator.h too.
* Add synchronous enableNetwork / disableNetwork helpers.
* Workaround for batch writes test flakiness.
2017-12-18 14:21:11 -08:00
Sebastian Schmidt 31b90e6ea8 Fixing return type of verifySnapshotWithResolvedTimestamps
This should address a crash that happens when a debugger is attached
2017-12-18 14:07:30 -08:00
Michael Lehenbauer d4de7a6e86 b/68276665: Raise isFromCache=true events when offline (#567)
* Plumbs FSTOnlineState changes through to views.
* View sets this.current to false on FSTOnlineStateFailed, triggering
	isFromCache=true events. It will automatically be returned to true
	once the listen is reestablished and we get a new CURRENT message.
* Updated tests (and added one new one) to verify behavior.
* Unifies setOnlineStateToUnknown, setOnlineStateToHealthy, and
	updateAndBroadcastOnlineState into a single updateOnlineState
	method.
* Split disableNetwork into (public) disableNetwork and
	(private) disableNetworkWithTargetOnlineState methods..
* Some miscellaneous comment cleanup.

* Add missing comment per CR feedback.
2017-12-15 14:56:03 -08:00
Sebastian Schmidt e006383cda Merge 2017-12-12 08:15:20 +08:00
Sebastian Schmidt e019a9461a Merge branch 'firestore-api-changes' into mrschmidt-timestamps 2017-12-12 08:03:59 +08:00
Sebastian Schmidt fe4783838e Addressing comments 2017-12-12 07:59:44 +08:00
Sebastian Schmidt 5b1ca51e72 Addressing comments 2017-12-12 07:11:39 +08:00
zxu 54ba423c87 Revisit commit method in FIRWriteBatch (#541)
* revisit FIRWriteBatch commit

*   make commitWithCompletion completion nullable;
*   add commit;
*   add unit test;
*   add swift build test for commit;
*   update CHANGELOG.
2017-12-11 15:37:01 -05:00
Sebastian Schmidt 23ee2aaf46 Clang format 2017-12-10 23:51:45 -08:00
Sebastian Schmidt bc179ea4ea Making DocumentSnapshot nullable 2017-12-10 14:40:22 -08:00
Sebastian Schmidt a2f9591f60 Fixing comment 2017-12-08 14:11:19 -08:00
Sebastian Schmidt 84e7f27a3f Adding default option 2017-12-08 14:02:23 -08:00
Sebastian Schmidt bf48b0abc1 Method renames 2017-12-07 19:54:08 -08:00
Sebastian Schmidt 904a141217 Addressing all review comments 2017-12-07 16:03:40 -08:00
zxu 5da88e4b9b Implement NSPredicate-based query (#531)
*   implement queryFilteredUsingPredicate in FIRQuery;
*   add unit test and integration test for queryFilteredUsingPredicate;
*   project change of adding the FIRQueryTests.m file;
*   refactoring queryFilteredUsingPredicate to split logic into two helpers;
2017-12-07 15:36:15 -05:00
Sebastian Schmidt a8948ced26 Adding SnapshotOptions to deal with pending ServerTimestamps 2017-12-05 23:22:16 -08:00
Paul Beusterien 3e592526ec Buildable and interoperable source pods (#444) 2017-11-21 17:02:22 -08:00
Gil 4fbc96904f Use fully qualified imports in Firestore (#467)
This simplifies the import process back into google3 and allows us to add additional directories to the project without needing to update the project files for each directory we add. This shows up most clearly in the change to Firestore/Example/Firestore.xcodeproj/project.pbxproj: this no longer needs to list essentially every directory in the project as a header search path.

* Clang-format configuration for C++ files
* Add support C++-only sources to the podspec
* Podspec support for fully qualified imports
* xcodeproj changes for fully-qualified imports
* Use fully-qualified imports in Firestore sources
2017-11-16 20:52:01 -08:00
Sebastian Schmidt 02ff6bbee9 Closing the write and watch stream after 60s of idleness (#388) 2017-10-30 18:17:16 -07:00
Sebastian Schmidt 642d304e23 Allowing field deletes with merge-enabled sets (#404) 2017-10-23 11:32:25 -07:00
Michael Lehenbauer 024788e38a Add isEqual() and port DocumentReference array test. (#380)
* Ports the test for the fix I made for Android for DocumentReference objects in arrays (bug not present in iOS).
* Implements isEqual on FIRQuery and FIRDocumentReference.
2017-10-19 08:23:25 -07:00
Gil a64495a33b Fix validation of nested arrays to allow indirect nesting (#377) 2017-10-16 15:56:19 -07:00
Sebastian Schmidt ae171bb226 Adding goOnline/goOffline to the RemoteStore (#347) 2017-10-11 04:51:05 +02:00
Sebastian Schmidt b532b7d191 Fixing XCTAssertEqual order (#356) 2017-10-10 07:45:17 -07:00
Sebastian Schmidt ce2191c04c Adding test for merge with server timestamps (#329) 2017-10-03 15:54:47 -07:00
Gil bde743ed25 Release 4.3.0 (#327)
Initial release of Firestore at 0.8.0
Bump FirebaseCommunity to 0.1.3
2017-10-03 08:55:22 -07:00