Commit Graph
613 Commits
Author SHA1 Message Date
rsgowman aa0dba767e Merge pull request #747 from firebase/rsgowman/nanopb
Integrate nanopb
2018-02-06 14:39:26 -05:00
Gil 20d6b9f2cd Merge pull request #757 from firebase/wilhuff/merge
Merge updated abseil-cpp to master
2018-02-06 11:02:22 -08:00
zxu a441190635 Implement Firestore DatabaseInfo and port both Database{Id,Info} C++ to the iOS code (#738)
* implement Firestore DatabaseInfo in C++

* temporary stash changes; blocking on the massive renaming of .m to .mm

* add database_info_test to project

* finish port DatabaseId and fix style, modular fixing DatabaseInfo

* port DatabaseInfo

* remove FSTDatabase{ID,Info} and their tests from project

* fix unit test

* use namespace alias

* use namespace alias, leftover

* address more changes

* refactoring to use raw pointer instead of value for property

* address changes

* remove self->

* fix style

* remove the name suffix Alloc

* fix a bug
2018-02-06 13:51:11 -05:00
Paul Beusterien 7cac9dc47a Fix firebaes typo (#755) 2018-02-06 10:42:56 -08:00
Rich Gowman 82a65ee12b Fix xcode build errors re nanopb
Involves adding PODS_ROOT/nanopb to include path (to allow include
<pb.h>) and Firestore/Protos/nanopb to include path (to allow include
"google/api/annotations.pb.h" and similar).

In both cases, this is to allow auto-generated code to function
properly.
2018-02-06 13:39:18 -05:00
Marek Gilbert ef59c11f82 Merge branch 'abseil-mirror' into merge
Add StrCat, StrJoin and the rest of //strings from abseil-cpp (#756)

From abseil-cpp version bf7fc9986e20f664958fc227547fd8d2fdcf863e
2018-02-06 10:06:42 -08:00
Marek Gilbert 53a125580d Merge commit 'abseil-mirror' into merge
Update abseil-cpp to a new upstream (#754)

Update to bf7fc9986e20f664958fc227547fd8d2fdcf863e
2018-02-06 09:43:24 -08:00
Gil 582e4baf37 Add StrCat, StrJoin and the rest of //strings from abseil-cpp (#756)
From abseil-cpp version bf7fc9986e20f664958fc227547fd8d2fdcf863e
2018-02-06 09:35:10 -08:00
Gil 28850292d4 Update abseil-cpp to a new upstream (#754)
Update to bf7fc9986e20f664958fc227547fd8d2fdcf863e
2018-02-06 09:28:30 -08:00
Rich Gowman 117669378c Ignore trailing whitespace in autogenerated nanopb files 2018-02-06 10:02:30 -05:00
Rich Gowman 189313e8b1 Minor refactoring 2018-02-06 10:02:30 -05:00
Rich Gowman fd0b332f46 Downgrade nanopb from 0.4.0-dev to 0.3.8.
Also regenerate the protos
2018-02-06 10:02:30 -05:00
Rich Gowman c896fab35f ./style.sh 2018-02-06 10:02:30 -05:00
Rich Gowman d29a6db896 style.sh now ignores generated nanopb files 2018-02-06 10:02:30 -05:00
Rich Gowman 3fcdf510ce Hook up nanopb to firestorep project
Use remote/serializer placeholder class as a hook for the test to ensure
nanopb headers can be found, and test can be linked.
2018-02-06 10:02:30 -05:00
Rich Gowman 9a71ce8e67 Import "well-known" protos (and generated nanopb files)
For use by nanopb (which otherwise doesn't know what to do with these.)
2018-02-06 10:02:30 -05:00
Rich Gowman 78e16f52a5 Add generated nanopb protos.
100% machine generated (except adding of the license).
2018-02-06 10:02:30 -05:00
Rich Gowman 11d28d80ff Add instructions for building nanopb protos
Currently only supported on osx
2018-02-06 10:02:30 -05:00
Rich Gowman ace2ed15fe Add ability to build nanopb and protobuf 2018-02-06 10:02:30 -05:00
Rich Gowman 15206e8df2 Skip 'update' step for external dependencies
We check them out from a git tag, so this *should* be a noop. However,
cmake seems to want to rebuild these dependencies every time you run
make as it assumes the dependency *might* have been updated. (In
practice, this isn't completely awful, as make notices the files haven't
changed, so files don't actually get recompiled. But the configure step
is still re-run and all the files still need to be rescanned.)

Skipping the update step speeds up the build considerably.

On my linux box, running:
  cmake .. && make -j && time make -j
takes ~8.5s prior to this CL and ~6.5 afterwards. (6s is used by the
test suite.) The upcoming protobuf addition would otherwise have made
this much worse. (It takes a long time to ./configure.)
2018-02-06 10:02:30 -05:00
Rich Gowman f12406716c Eliminate sequencing dependencies
We originally had this as it was thought that cmake would spawn n*m jobs
(where n is the number of jobs it was instructed to create, ie. make
-j8, and m is the number of external projects.) However, it isn't
supposed to do that, and doesn't appear to be doing that right now. So
we'll remove this.

If the problem re-appears, we'll add these back in. (Symptom was being
unable to spawn /bin/sh.)
2018-02-06 10:02:30 -05:00
Gil 32266c5d1c Make sure Firestore/core/include is in the podspec (#748) 2018-02-02 13:12:24 -08:00
Morgan Chen 070c0ea92f Merge pull request #746 from morganchen12/unguarded-block
fix null block execution crash
2018-02-02 11:43:14 -08:00
Morgan Chen 7422f62182 fix null block execution crash 2018-02-02 11:31:32 -08:00
Michael Lehenbauer 13f572ea2c Increase expectation timeout to 25 seconds. (#744)
I'm doing this to:
1) Experimentally see if it improves the flakiness we've been seeing in the Query Conformance Tests.
2) Insulate us from the fact that GRPC seems to take a /minimum/ of 10 seconds to reconnect (at least in some cases) after a connection failure.

I've opened b/72864027 to revisit this in the future.
2018-02-02 10:25:41 -08:00
Chen Liang 47d81fdf65 fix (#739) 2018-02-01 13:48:39 -08:00
Gil d45900b85b Align tests and integration test header search paths (#737) 2018-02-01 13:14:53 -05:00
Gil 515625c47f Remove predecessorKey,Object,Document, etc (#735)
This is dead code.

I think it was probably useful in the RTDB because of the way it notified of changes, but we give changes with indexes in Firestore so I think we don't need it.
2018-02-01 07:55:49 -08:00
Gil ac30522234 Start on ArraySortedMap in C++ (#721)
* Implement ArraySortedMap.remove
* Implement ArraySortedMap.insert
* Ensure ArraySortedMap.insert avoids copying on duplicates
* Port more ArraySortedMapTests
2018-01-31 14:28:20 -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
Oleksiy Ivanov 693d0649bf Merge pull request #732 from OleksiyA/FCM-subscribe-completion-1
[FCM] Add completion handler to subscribe/unsubscribe topic actions
2018-01-31 10:14:42 -08:00
Oleksiy Ivanov 4e4c82b659 Fix tests. 2018-01-31 09:47:18 -08:00
Oleksiy Ivanov 799a808de6 [FCM] Add completion handler to subscribe/unsubscribe topic actions
Added functionality not exposed in public header yet. I would leave to next FCM SDK owner to expose this functionality (and follow any required review process).

Bugs:
72701086
2018-01-30 16:33:12 -08:00
Greg Soltis 3cbdbf2652 Schema migrations for LevelDB (#728)
* Implement schema versions

* Style fixes

* newlines, copyrights, assumptions

* Fix nullability

* Raw ptr -> shared_ptr

* kVersionTableGlobal -> kVersionGlobalTable

* Drop utils, move into static methods

* Drop extra include

* Add a few more comments

* Move version constant into migrations file

* formatting?

* Fix comment
2018-01-30 14:36:22 -08:00
zxu 6474a82fd6 Firestore DatabaseId in C++ (#727)
* Implement DataBaseId in C++

* add database_id_test to project

* fix project

* address changes

* fix style
2018-01-29 15:55:01 -05:00
rsgowman 05ef5aea13 Add absl_strings to firebase_firestore_util_test dependencies (#725)
Required to link the test on rodete.
2018-01-29 12:10:25 -05:00
Michael Lehenbauer 03a006920f Add changelog entry for my last PR (oops) and also add a few that we missed last release. (#724) 2018-01-29 08:58:13 -08:00
Gil 5a280ca1d6 Import iterator_adaptors from google3 (#718)
* Import iterator_adapters from google3

* Remove -Wconversion which is annoyingly hard to satisfy

* Strip dependency on absl_container from iterator_adapters_test

* Format and lint iterator_adaptors

* More flexible copyright checking in Travis
2018-01-29 08:38:32 -08:00
Gil 63a380ba33 Use fixed-sized types (#719)
Should have caught this during review, but cpplint caught it
2018-01-28 19:40:53 -05:00
Paul Beusterien 6dc13731f6 Version updates to 4.8.2 (#722) 2018-01-27 18:40:25 -08:00
rsgowman a74d39f02b Fix a number of c++ build errors (#715)
* Move -fvisibility-inlines-hidden from common_flags to cxx_flags

This option isn't supported by C (and causes the build to fail under
at least rodete).

Manifested error was:

```
-- Looking for include file openssl/rand.h
-- Looking for include file openssl/rand.h - not found
CMake Error at core/src/firebase/firestore/util/CMakeLists.txt:94 (message):
  No implementation for SecureRandom available.

-- Configuring incomplete, errors occurred!
```

which is completely misleading. :(

* Fix exception include for std::logic_error

Was causing compiler error on (at least) rodete.

(http://en.cppreference.com/w/cpp/error/logic_error suggests that
stdexcept is the correct header.)

* Remove 'const' from vector contents.

vectors cannot contain const objects as the contained objects are
required to be assignable and copy constructable. (Not *quite* strictly
true; since c++11, this requirement now depends on the operations
performed on the container. But my compiler objects at any rate.)

http://en.cppreference.com/w/cpp/container/vector

https://stackoverflow.com/questions/8685257/why-cant-you-put-a-const-object-into-a-stl-container

* Add brackets as suggested (required) by my compiler.

* Add missing include

For LLONG_MIN, etc.

* Enable gnu extension to c++11 for firestore/util *test*.

We disable them by default (in cmake/CompilerSetup.cmake) but our tests
requires hexidecimal floating point, which is not supported in c++11
(though is supported in C++17, gnu++11, and others).

http://en.cppreference.com/w/cpp/language/floating_literal
https://bugzilla.redhat.com/show_bug.cgi?id=1321986

* Fix printf format for uint64_t

http://en.cppreference.com/w/cpp/types/integer
https://stackoverflow.com/questions/9225567/how-to-print-a-int64-t-type-in-c

* Allow 0 length printf template strings in tests.

* Get rid of a multi line comment.

The backslash is apparently interpreted by the compiler cause the next
line to be ignored too. In this case, the next line is (currently) a
comment, and would be ignored anyways. (But that doesn't stop the
compiler from yelling.)

* Run ./scripts/style.sh
2018-01-27 16:16:41 -08:00
Gil 856c3a09f1 Add the C++ linter to the repo (#720) 2018-01-27 16:13:14 -08:00
Paul Beusterien cceeec3e7b travis: check for copyright in sources (#717) 2018-01-27 16:00:28 -08:00
Michael Lehenbauer 4d7c973369 Fix b/72502745: OnlineState changes cause limbo document crash. (#470) (#714)
[PORT OF https://github.com/firebase/firebase-js-sdk/pull/470]

Context: I made a previous change to raise isFromCache=true events when the
client goes offline. As part of this change I added an assert for
"OnlineState should not affect limbo documents", which it turns out was not
valid because:
* When we go offline, we set the view to non-current and call
	View.applyChanges().
* View.applyChanges() calls applyTargetChange() even though there's no target
	change and it recalculates limbo documents.
* When the view is not current, we consider no documents to be in limbo.
* Therefore all limbo documents are removed and so applyChanges() ends up
	returning unexpected LimboDocumentChanges.

Fix: I've modified the View logic so that we don't recalculate limbo documents
(and generate LimboDocumentChanges) when the View is not current, so now my
assert holds and there should be less spurious removal / re-adding of limbo
documents.
2018-01-27 15:03:05 -08:00
zxu af6976a907 normalize and port the rest of Firebase/Port code (#713)
* normalize bits
* normalize ordered_code
2018-01-27 14:53:27 -08:00
zxu 7226b4adf3 port TargetIdGenerator to iOS (#709)
* port TargetIdGenerator to iOS

* fix style

* move pointer property to instance variable

* TriggerTravis
2018-01-25 18:39:46 -05:00
Chen Liang 5306474396 adding unit test for auto init enable function (#710) 2018-01-25 13:44:22 -08:00
zxu 821fb909a3 implement TargetIdGenerator in C++ for Firestore (#701)
* implement `TargetIdGenerator`

* address changes
2018-01-25 13:05:30 -05:00
zxu 5fdda3fa83 normalize string_util (#708)
* refactoring string_util
* port string_util to iOS
2018-01-25 13:03:07 -05:00
Ryan Wilson 15a2926dcb Update CHANGELOG for M21.1 release (#679) 2018-01-25 08:53:25 -08:00