Commit Graph
160 Commits
Author SHA1 Message Date
Mila 3f5972f920 Firestore: Optimize local cache sync when resuming a query that had docs deleted (#11457) 2023-06-20 12:10:39 -04:00
Tom Andersen f2194c8a3c Allow initializing FIRLocalCacheSettings with unlimited size. (#11405)
* Allow initializing FIRLocalCacheSettings with unlimited size.

* Add changelog.

* Add test

* Fix bug

* Add import

* Add import

* Exercise db with CacheSizeUnlimited

* Fix
2023-06-07 19:53:52 -04:00
wu-hui 8066d190fc Suppress warning from boringssl (#11281)
* Suppress warning from boringssl

* Try out target exclusion

* Skip a failed tsan test

* Add todo
2023-05-18 19:32:56 -04:00
Mark Duckworth 52ebbbf19d Sum and average (#11108)
This is implementation but not public release of sum and average. The sum/avg API is not made public. There are no API changes in this PR.
2023-05-12 13:56:16 -06:00
Denver Coneybeare a00925f7eb FIRQueryTests.mm: improve the test that resumes a query with existence filter to actually validate the existence filter (#11209) 2023-05-05 14:58:26 -04:00
Denver Coneybeare 0c58855437 Firestore: FIRQueryTests.mm: add a test that resumes a query with existence filter (#10974) 2023-05-02 11:32:33 -04:00
wu-hui 7c8becdbba New Cache Config API (#11057) 2023-04-13 20:52:14 -04:00
cherylEnkidu b2383a9d3c Reorganize OR query test (#10902)
* Reorganize OR query test

* Address comments

* Change message
2023-03-14 22:48:51 -04:00
cherylEnkiduandEhsan Nasiri c0e6ac1cf2 Add Public API for Or Query (#10352)
* Add Public API for Or Query

* Add Or query swift tests

* Add Swift tests for IN

* Adding back FIRFirestore+Internal as include file

* Add Documentation

* Address feedback

* Update the changelog.

---------

Co-authored-by: Ehsan Nasiri <ehsann@google.com>
2023-03-06 09:43:06 -08:00
cherylEnkidu 6d9f33435a Remove some query restrictions and add integration tests (#10449)
* Adding test

* Remove more restrictions
2023-02-17 11:18:34 -05:00
cherylEnkidu 10295bad6b Fix double free bug inside IN Filter (#10535) 2022-11-30 12:52:59 -08:00
Tom Andersen 68628ef4e3 Implement MultiDB Support and Tests (#10465) 2022-11-24 10:52:38 -05:00
Denver Coneybeare 92e269c34e Fix Firestore failing to return empty results from the local cache (#10437) 2022-11-08 20:50:01 -05:00
cherylEnkidu 6d24463357 Update Limit and OrderBy filtering mechanism for Or Query (#10307)
* Update Limit and OrderBy filtering mechanism for Or Query

* Remove TODO
2022-10-13 10:47:51 -04:00
Denver Coneybeare a15469ead5 Enable COUNT integration tests, now that backend support has rolled out (#10299) 2022-10-04 11:37:44 -04:00
Morgan Chen 5af4ae2967 Fix missing aggregate query headers in umbrella (#10301)
* Fix missing aggregate query headers in umbrella

* remove duplicate import in test
2022-10-03 19:41:40 -07:00
4232ac1d2e Public count (#10254)
* Revert "Revert "Public count (#10246)" (#10252)"

This reverts commit b695d99e91.

* Firestore: Re-write API docs for COUNT API (#10258)

* Add isEqual and hash for aggregate classes (#10261)

Co-authored-by: Denver Coneybeare <dconeybe@google.com>
Co-authored-by: Ehsan <ehsannas@gmail.com>
2022-09-27 18:01:22 -07:00
wu-hui b695d99e91 Revert "Public count (#10246)" (#10252)
This reverts commit 8aae6bee27.
2022-09-23 11:22:05 -04:00
wu-hui 8aae6bee27 Public count (#10246)
* Public Count

* Swift Test Commit

* Swift Format

* No extra whitespace

* Hopefully formatted.

* Change log and feedback.
2022-09-23 11:06:06 -04:00
wu-hui 84a8b5030c Count from server (#10193)
* Proto serialization

* Wire up api

* End to end functional

* Linting

* Add aggregate source

* Fix cmake and style

* Comments, emulators and lints

* Feedback.

* More feedback.
2022-09-14 15:43:35 -07:00
cherylEnkidu 3512851cf6 Implement the Composite Filter class (#9734)
* Implement the Composite Filter class

* Polish code

* add tests for composite filter

* fix broken test

* Improve the implementation of flattern filters

* change the flatten_filters implementation with some other things

* Change the implementation of Filter in Composite Filter

* Address feedback

* Match Android Tests
2022-08-19 14:44:00 -04:00
cherylEnkiduandWu-Hui cc9c626501 Add setIndexConfiguration for client side indexing (#10090)
* Add setIndexConfiguration for client side indexing

* Address feedback

* Templates in headers

Co-authored-by: Wu-Hui <wu.hui.github@gmail.com>
2022-08-18 10:51:08 -04:00
wu-hui b63819219d Overlays integrate with mutations and queries, and migration (#9731) 2022-05-23 20:47:53 -04:00
wu-hui 939f1318ca Fix a bug with limitToLast and cursors (#9675) 2022-04-20 13:07:26 -04:00
Nick Cooke a09083f9d0 [v9] Reorganize FirebaseCore* modules (#9482)
* [skip ci] [will revert] Add debug printing to `pod_lib_lint.rb`

* Reorganize FirebaseCore libraries for SPM and CP

* [skip ci] Revert "[skip ci] [will revert] Add debug printing to `pod_lib_lint.rb`"

This reverts commit 2a837e39708c21b0a324743ab226bd6c01047de7.

* Review and fix CI

* Remove `heartbeat_logging.yml` and add `core_internal.yml`

* Remove trailing whitespace

* Fix more whitespace 😞

* Fix `core_internal.yml` scheme name

* Update `check_imports.swift` and TODO

* Review

* Add FirebaseCoreInternal pod to Firestore example's Podfile

* [skip ci] Review - remove TODOs

* [skip ci] Remove duplicate `XCTest` import
2022-03-23 06:08:14 -07:00
Paul Beusterien 6361347a22 Podspecs for CoreInternal and AppCheckInterop (#9300) 2022-03-23 06:08:03 -07:00
Paul Beusterien 4f793064da Set up Core Internal for SPM (#9298) 2022-03-23 06:07:17 -07:00
Denver Coneybeare 04b7555228 Get rid of util and testutil namespace aliases (#8917) 2021-11-02 22:31:45 -04:00
wu-hui 554ad41247 Change some tests to validate against message prefix only (#8839) 2021-10-20 18:20:48 -07:00
Denver Coneybeare 58c7566706 Fix a Firestore transaction crash if getDocument was called after terminateWithCompletion (#8760) 2021-10-08 10:31:43 -04:00
Konstantin Varlamov f243335a25 Don't define a util namespace alias in the global namespace. (#8527)
This would conflict with any definition of a `util` namespace imported from a header. While this applies to other aliases as well, `util` is the one most likely to clash and the one that has actually caused problems.

#no-changelog
2021-09-24 09:11:41 -06:00
Ehsan d191d0e1dd Do not consider MutableDocument's state for DocumentSnapshot comparison (#8647)
* `operator==` (isEqual) behavior for DocumentSnapshot.

* Do not consider MutableDocument's state for DocumentSnapshot comparison.

* Address comments.

* Update changelog.

* Don't compare the key twice.
2021-09-21 15:06:17 -05:00
Paul Beusterien b64e0fc623 Fix Firestore test build on Xcode 13 (#8575) 2021-08-25 09:03:19 -07:00
Konstantin Varlamov 633fa5561f Explicitly check that document and collection IDs given to the public API aren't empty (#8248)
Currently, the error would look like `Document references must have an even number of segments, but has 0`.

Fixes #8218.
2021-06-14 18:23:11 -04:00
Konstantin Varlamov edb839e24a Minor error handling improvements (#8061)
* Throw more specific exceptions when the error is due to bad input (backport of cr/359824564) (note that this only applies to the Unity build);
* Always log exceptions to make sure they make it into the log (regardless of exception handling by the user and any potential issues with the exception propagation mechanism).

#no-changelog
2021-05-12 15:27:58 -04:00
wu-hui 9f36662ee8 Delete an unwanted include (#7786) 2021-03-25 16:04:12 -04:00
wu-hui fbdca9590a Release Firestore bundles (#7717)
* Introduce new bundle.proto (#7283)

* Create leveldb "table"s for bundles (#7303)


* Add bundle cache (#7320)

* Bundle json parsing (#7356)

* BundleSerializer complete. (#7454)

* Bundles LocalStore change (#7466)

* Implement bundle reader to parse a bundle inputstream (#7527)

* Implement BundleLoader (#7536)

* Add public API for bundles and integration tests (#7621)

* Json parser as a hard copy (#7678)

* fix asan errors (#7686)

* Changelog entry

* Add public comments for bundles (#7694)

* Should 7.9.0

* API amendment
2021-03-16 17:07:47 -04:00
Konstantin Varlamov f1294cee91 Fix a crash that happens when Firestore is being terminated when the last shared pointer to it is in a listener (#7421)
If a user calls terminate and immediately disposes their reference to Firestore, it's possible that while termination is in process, the last remaining reference (more precisely, shared pointer) to Firestore is in a listener. When that listener is destroyed as part of the termination, it leads to `api::Firestore` being destroyed. Importantly, termination happens on the worker queue. The destructor of `api::Firestore` calls `Dispose` which presumes it's not called from the worker queue and tries to enqueue work, leading to a failing assertion and a crash.

The solution is simply to remove the sequential order checks when the queue enters/is in restricted mode. There is a legitimate case where the Firestore destructor can run on the worker queue, as the original issue shows. The complexity of #7412 also indicates that a simpler solution is preferable.

Fixes #6909.
2021-02-02 19:05:45 -05:00
Konstantin Varlamov ac04fb69df Fix a duplicate key in test data (#7327)
This triggers the -Wobjc-dictionary-duplicate-keys warning, causing the compilation to fail when -Werror is used. Introduced in #6871.

#no-changelog
2021-01-19 17:24:28 -05:00
Brian Chen 1c1ca000c6 Allow null/NAN values in filters (#6871) 2020-11-02 12:52:30 -06:00
Gil 885b07be6a Remove support for setting timestampsInSnapshotsEnabled (#6622)
Snapshots will now always include `FIRTimestamp` values. Use
`[FIRTimestamp dateValue]` to convert to `NSDate` if required.

`timestampsInSnapshotsEnabled` was deprecated in Firebase 5.16.0
(January 22, 2019) and has defaulted to true since then.

Projects that have not enabled `timestampsInSnapshotsEnabled` have
logged a warning since Firebase 4.12.0 (April 10, 2018).
2020-10-13 13:05:33 -07:00
Brian Chen 21921e9851 Add != and notIn support (#6418) 2020-09-15 16:12:44 -05:00
Denver Coneybeare 69c3e4b9e5 Add an integration test for callbacks on the main thread (#6054) 2020-07-16 15:06:22 -04:00
Denver Coneybeare ffe23884da Add #include for config.h to get the value for HAVE_LIBDISPATCH (#6041) 2020-07-14 15:38:18 -04:00
Gil 59c8c95501 Have ListenerRegistration::Remove block until callbacks are complete (#5961)
* Add the ability to await a single expectation

* Await individual expectations in test helpers

This prevents tests from accidentally awaiting unrelated expectations
when using the helpers.

* Fix tests that implicitly relied on test helpers to await all

* Add a test that verifies ListenerRegistration::Remove blocks

* Block ListenerRegistration::Remove when there are outstanding callbacks.

* Test that remove does not block when called from the callback.
2020-07-06 13:06:36 -07:00
Gil 6f12f3871b Make snapshots in sync listener registration removal idempotent (#5945) 2020-06-30 09:32:37 -07:00
Gil eb6d343677 Fix TSAN errors in FIRListenerRegistrationTests (#5943) 2020-06-30 08:20:27 -07:00
Paul Beusterien d4621a636f Use preserve_paths instead of CocoaPods private (#5758) 2020-06-09 05:21:28 -07:00
Denver Coneybeare df3679275c Add an integration test for calling clearPersistence() on a newly-created Firestore instance. (#5515) 2020-05-04 14:55:17 -04:00
Gil 7a58eba2e5 Remove firebase/firestore from paths in Firestore/core (#5374)
* Manual Xcode project fixups

* Remove `firebase/firestore` from paths in Firestore/core

This renames all Firestore files under `Firestore/core` to remove the
interior `firebase/firestore` directory structure. This is motivated by
build failures under Windows where the filenames of intermediates were
too long.

Concretely:

  * `Firebase/core/src/firebase/firestore` becomes `Firebase/core/src`
  * `Firebase/core/test/firebase/firestore` becomes
    `Firebase/core/test/unit`

Moving the tests into a `unit` subdirectory aligns Firestore with the
directory structure in
[AddNewPod](https://github.com/firebase/firebase-ios-sdk/blob/master/AddNewPod.md),
modified for C++ (see discussion in #3224).
2020-04-20 14:57:34 -07:00