Skip to content
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

Implement the rest of FieldValue types for C++ #687

Merged
merged 23 commits into from
Jan 25, 2018
Merged

Conversation

zxu123
Copy link
Contributor

@zxu123 zxu123 commented Jan 20, 2018

Discussion

go/firestorecppfieldvalue

Testing

Unit test

API Changes

go/firestorecppfieldvalue

Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a first pass on this but let's discuss before this goes too much farther.

/** Build a new Blob and take the ownership of source. */
static Blob MoveFrom(void* source, size_t size);

const void* Get() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property accessors should be lower-case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack


Blob& operator=(const Blob& value);

void Swap(Blob& value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please define swap as a friend function suitable for use with ADL if we can.

This should be

friend void swap(Blob& lhs, Blob& rhs);

You should be able to call swap like this:

TEST(Blob, SwapsViaArgumentDependentLookup) {
  Blob foo = Blob.CopyFrom("foo", 4);
  Blob bar = Blob.CopyFrom("bar", 4);
  
  using std::swap;
  swap(left, right);
 
  EXPECT_EQ("bar", static_cast<const char*>(foo.get()));
  EXPECT_EQ("foo", static_cast<const char*>(bar.get()));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. Don't need it anymore since we now use C++11 language feature and have rvalue overload of operator=.

/** Immutable class representing an array of bytes in Firestore. */
class Blob {
public:
Blob(const Blob& value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that while we cannot use C++11 library features because of STLport, all target platforms at least support C++11 language features.

Our worst-case platform for this API is NDK 10d using the STLport runtime which has Clang 3.5 and GCC 4.6 as compilers.. Clang 3.5 implements C++14 and GCC 4.6 implements enough of C++11 that we can declare move constructors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

}

private:
Blob();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please declare this publicly as a deleted constructor:

Blob() = delete;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need a private one to initialize a Blob inside builder function.

static Blob CopyFrom(const void* source, size_t size);

/** Build a new Blob and take the ownership of source. */
static Blob MoveFrom(void* source, size_t size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a problematic API:

  1. In the implementation free() on this pointer, but you haven't specified that the source should have been allocated with malloc(). The value could just have been allocated with new[] which will cause a mismatch and corrupt memory: https://blogs.msdn.microsoft.com/oldnewthing/20040203-00/?p=40763/#66782

  2. To remedy this, we might allow the user to supply a deleter function for us to call back when we're done with the value, but this is problematic because:

    • This value is supposed to be scalar-like
    • so it won't be be connected to any particular instance of Firestore
    • so we won't have access to a user callback queues in this class's destructor
    • which means we'd have to execute the deleter in the current thread.
    • We do not allow user code to run in a Firestore worker thread
    • so we just can't accept values with a user deleter into the core.
    • In turns this means we'd have to copy the value which defeats the point of this API
  3. The RTDB variant has a different contract: either the value is copied in (known there as mutable) or not copied/not freed (known there as static). This is free of this API problem but requires us to know whether or not to delete the blob.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the Blob is internal and we assume it wraps byte arrays. It also owns the wrapped array, either a copy of user's data or the moved user's data, depending on which builder function to call. In other words, our Blob is always in the mutable sense and never in static sense in the RTDB point of view.

Timestamp::Timestamp() : seconds_(time(nullptr)), nanos_(0) {
}

bool Timestamp::IsOrigin() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timestamps in the existing iOS implementation don't have a notion of an "origin" timestamp and don't treat timestamps specially based on them being origins or not. In particular I'm not sure this is even a good idea because users are allowed to use such a value for their own purposes so we can't make origins special.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here in C++ is that iOS previous_value is Nullable and thus we need a dummy value for previous_value to present the null value. How about make a null value of timestamp that is not overlap with any true timestamp and just call the API function bool Timestamp::IsNull() and static Timestamp Timestamp::NullValue()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reconcile this with @varconst-fb since this will be a public API.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zxu123, do you refer to previousValue in FSTServerTimestampValue? If yes, perhaps you could store previousValue as absl::optional, and for constructor/factory function, provide two overloads, with and without previousValue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll port abseil's optional in a separate PR. @wilhuff any comment on porting abseil's optional? The port only introduce additional:

  • absl/memory/memory.{h,cc},
  • absl/base/macros.{},
  • absl/base/port.h,
  • absl/base/attributes.,
  • abs/base/config.,
  • abs/base/optimization.,
  • abs/utility/utility.,
  • absl/base/internal/invoke.h,
  • absl/types/bad_optional_access.h,

absl::optional might be also useful for other part of the C++ code due to the lack of mechanism of C++ to allow value types being null.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presumed we depended on Abseil, so I didn't expect this to be an issue. I guess it's possible to just have a flag inside ServerTimestamp like bool has_previous_value_. Unless there are other places which need some sort of a NaN timestamp, I'd keep this quirk inside implementation of ServerTimestamp instead of introducing a sentinel Timestamp value.

OTOH, optional will probably find other uses. I'll defer to @wilhuff on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on these comments yesterday I started work on just doing a full import of abseil rather than doing it piecewise as we've done so far. I've come across a blocking issue I hope to work out with the abseil team today (though who knows how long it will take for my proposal to actually land in their github repo).

For now I would add the has_previous_value_ and a TODO so we can make progress without that dependency.

namespace firebase {
namespace firestore {
namespace model {

struct ServerTimestamp {
Timestamp local;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please preserve the more descriptive names we had before. local_write_time conveys more than just local.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

default: {} // The other types where there is nothing to worry about.
}
tag_ = type;
// Must call constructor explicitly for any non-POD type to initialize.
switch (tag_) {
case Type::Timestamp:
new (&timestamp_value_) Timestamp(0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp constructor would throw on these arguments.

Perhaps we're better off just making Timestamp default constructable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a constructor of Timestamp with no parameter, which sets timestamp to now. To get now is costly in particular what the value here does not really matter and thus that operation is in waste.

0 seconds and 0 nanos is a valid timestamp by design, see the assertion in iOS implementation:

    FSTAssert(nanos >= 0, @"timestamp nanoseconds out of range: %d", nanos);
    FSTAssert(nanos < 1e9, @"timestamp nanoseconds out of range: %d", nanos);
    // Midnight at the beginning of 1/1/1 is the earliest timestamp Firestore supports.
    FSTAssert(seconds >= -62135596800L, @"timestamp seconds out of range: %lld", seconds);
    // This will break in the year 10,000.
    FSTAssert(seconds < 253402300800L, @"timestamp seconds out of range: %lld", seconds);

The alternative design (and divert from the other SDK's) is to allow default construction to set everything to 0 and define a builder method to return timestamp that contains now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, Timestamp is going to be a public type so we need to take some care.

My intuition is that Timestamp should default construct with zero values and we should add a Timestamp::Now() factory function to actually get current time.

/cc @varconst-fb

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of having a default constructor that initializes the value to zero:

  • Timestamp looks like it should have value semantics;
  • I think it's more idiomatic for a default-constructed object to be in an "empty" state;
  • it's consistent with what std::chrono::time_point does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. I think we may want a document to record the diversion of C++ implementation and ObjC implementation; here the default ctor behavior of Timestamp is one. This way may help people avoid making certain type of mistake like replace the construct of Timestamp but forgot to initialize with Now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've done this in the past with "PORTING NOTE" in the comments of the class in question where there's a divergence.

https://github.com/firebase/firebase-js-sdk/search?utf8=%E2%9C%93&q=%22PORTING+NOTE%22&type=

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

case Type::ServerTimestamp:
// We initialize them to origin to avoid expensive calls to get `now'.
new (&server_timestamp_value_)
ServerTimestamp{Timestamp::Origin(), Timestamp::Origin()};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Timestamp were default constructable then you wouldn't need to call this constructor explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. see last comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

new (&blob_value_) Blob(Blob::CopyFrom(nullptr, 0));
break;
case Type::GeoPoint:
new (&geo_point_value_) GeoPoint(0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Types that aren't default-constructable aren't very user friendly if they're intended to be used as value types.

We should just make these have a default constructor so that we're not littering the callers with this kind of stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the other client SDK's has constructor of GeoPoint without parameters. On the other hand, the C++ language does make it different from other SDK, where variables are mostly reference. Let me add default constructor to GeoPoint for now; probably worth to discuss since this goes into the public api geo_point.h.

Copy link
Contributor Author

@zxu123 zxu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL

namespace firestore {

/** Immutable class representing an array of bytes in Firestore. */
class Blob {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. Let me the Blob definition into /model/; this comes handy to define FieldValue union since blob needs both allocation and size.

/** Immutable class representing an array of bytes in Firestore. */
class Blob {
public:
Blob(const Blob& value);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

static Blob CopyFrom(const void* source, size_t size);

/** Build a new Blob and take the ownership of source. */
static Blob MoveFrom(void* source, size_t size);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now the Blob is internal and we assume it wraps byte arrays. It also owns the wrapped array, either a copy of user's data or the moved user's data, depending on which builder function to call. In other words, our Blob is always in the mutable sense and never in static sense in the RTDB point of view.

/** Build a new Blob and take the ownership of source. */
static Blob MoveFrom(void* source, size_t size);

const void* Get() const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack


Blob& operator=(const Blob& value);

void Swap(Blob& value);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. Don't need it anymore since we now use C++11 language feature and have rvalue overload of operator=.

default: {} // The other types where there is nothing to worry about.
}
tag_ = type;
// Must call constructor explicitly for any non-POD type to initialize.
switch (tag_) {
case Type::Timestamp:
new (&timestamp_value_) Timestamp(0, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a constructor of Timestamp with no parameter, which sets timestamp to now. To get now is costly in particular what the value here does not really matter and thus that operation is in waste.

0 seconds and 0 nanos is a valid timestamp by design, see the assertion in iOS implementation:

    FSTAssert(nanos >= 0, @"timestamp nanoseconds out of range: %d", nanos);
    FSTAssert(nanos < 1e9, @"timestamp nanoseconds out of range: %d", nanos);
    // Midnight at the beginning of 1/1/1 is the earliest timestamp Firestore supports.
    FSTAssert(seconds >= -62135596800L, @"timestamp seconds out of range: %lld", seconds);
    // This will break in the year 10,000.
    FSTAssert(seconds < 253402300800L, @"timestamp seconds out of range: %lld", seconds);

The alternative design (and divert from the other SDK's) is to allow default construction to set everything to 0 and define a builder method to return timestamp that contains now.

case Type::ServerTimestamp:
// We initialize them to origin to avoid expensive calls to get `now'.
new (&server_timestamp_value_)
ServerTimestamp{Timestamp::Origin(), Timestamp::Origin()};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. see last comment.

new (&blob_value_) Blob(Blob::CopyFrom(nullptr, 0));
break;
case Type::GeoPoint:
new (&geo_point_value_) GeoPoint(0, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the other client SDK's has constructor of GeoPoint without parameters. On the other hand, the C++ language does make it different from other SDK, where variables are mostly reference. Let me add default constructor to GeoPoint for now; probably worth to discuss since this goes into the public api geo_point.h.

namespace firebase {
namespace firestore {
namespace model {

struct ServerTimestamp {
Timestamp local;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Timestamp::Timestamp() : seconds_(time(nullptr)), nanos_(0) {
}

bool Timestamp::IsOrigin() const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here in C++ is that iOS previous_value is Nullable and thus we need a dummy value for previous_value to present the null value. How about make a null value of timestamp that is not overlap with any true timestamp and just call the API function bool Timestamp::IsNull() and static Timestamp Timestamp::NullValue()?

Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More feedback to keep you going.

#ifndef FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_
#define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_

#include <string.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

/** Immutable class representing a GeoPoint in Firestore */
class GeoPoint {
public:
GeoPoint();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we intend GeoPoint to be copy/move constructable using the generated constructors we should document it:

GeoPoint(const GeoPoint& other) = default;
GeoPoint(GeoPoint&& other) = default;

This has the extra benefit that should we make a change that breaks the compilers ability to generate these constructors it will fail our build rather than just silently omitting them and breaking our customers' builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Explicitly makes those default; frankly speaking, I don't aware any compiler that will omit those default in our case here.

  GeoPoint(const GeoPoint& other) = default;
  GeoPoint(GeoPoint&& other) = default;
  GeoPoint& operator=(const GeoPoint& other) = default;
  GeoPoint& operator=(GeoPoint&& other) = default;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I should have been clearer in what I meant.

I agree that no compiler would omit these today. However, should we accidentally make a change to this class that made it not trivially copyable then we might not realize it before we broke our customers. If you include these declarations and the compiler cannot generate the default implementations because we've made such a change it will fail the build.

Since this is a public API I'm advocating that it's worth it to protect us from ourselves :-).

public:
GeoPoint();

GeoPoint(double latitude, double longitude);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please port documentation comments from the objective-C implementation:

https://github.com/firebase/firebase-ios-sdk/blob/master/Firestore/Source/Public/FIRGeoPoint.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


#include "Firestore/core/include/firebase/firestore/geo_point.h"

#include <math.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like any of these headers are used (besides firebase_assert)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnan in math.h. The other std library is not used and removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry missed that.

}

bool operator<(const Blob& lhs, const Blob& rhs) {
int comparison =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is std::lexicographical_compare. Use it like so:

return std::lexicographical_compare(
    lhs.begin(), lhs.end(),
    rhs.begin(), rhs.end());

This presupposes that blob has begin() and end() functions that make it compatible with normal C++ container-like utilities like so:

const uint8_t* begin() const {
  return buffer_;
}

const uint8_t* end() const {
  return buffer_ + size_;
}

However, see above: if make the buffer a std::vector then you can just use the comaparator I've already defined:

struct Comparator<std::vector<uint8_t>>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

Blob Blob::CopyFrom(const uint8_t* source, size_t size) {
uint8_t* copy = new uint8_t[size];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're always copying now, is there any reason not to make our internal buffer just use std::vector<uint8_t>?

At that point we stop having to worry about managing pointers at all.

Given an external source and size, you can construct the vector directly:

std::vector<uint8_t> buffer(source, source + size);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not always copying; it always takes ownership a.k.a. either make a copy and take ownership of that copy (by calling CopyFrom) or directly take the passing-in's ownership and not make a copy (by calling MoveFrom). There is no way to achieve the MoveFrom(const uint8_t* source, size_t size) via std::vector.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you're saying is true (that we can't move from something else while using vector) but the reality is that the the public API is going to be firebase::Variant which has two kinds of values:

  • "mutable" blobs, whose values were allocated by the Variant
  • "static" blobs, whose values were passed by the caller and the caller still owns

You can't move from either of these:

  • In the "mutable" case the user has declared the variant to have a type of value and we can't change that type. Therefore the buffer is owned by the Variant.
  • In the "static" case we can't take control of the user buffer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the discussion went too far on the Blob for implementing FieldValue type. Since CPU cost is not a main concern as in our OKR discussion for now while code size and complexity is the main concern, let me just use the std::vector<uint8_t> in FieldValue. There is no point to wrap around a std::vector<uint8_t> via a Blob here as all the Blob API in the end is simply dedicated to std::vector API calls.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a reasonable conclusion.

}

inline bool operator!=(const Blob& lhs, const Blob& rhs) {
return lhs < rhs || lhs > rhs;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems suboptimal because it requires two memcmps. Better to define equality directly. If you make buffer_ a vector then this can just be lhs.buffer_ == rhs.buffer_.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. reimplemented. cannot use vector, see comment above.

default: {} // The other types where there is nothing to worry about.
}
tag_ = type;
// Must call constructor explicitly for any non-POD type to initialize.
switch (tag_) {
case Type::Timestamp:
new (&timestamp_value_) Timestamp(0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, Timestamp is going to be a public type so we need to take some care.

My intuition is that Timestamp should default construct with zero values and we should add a Timestamp::Now() factory function to actually get current time.

/cc @varconst-fb

Timestamp::Timestamp() : seconds_(time(nullptr)), nanos_(0) {
}

bool Timestamp::IsOrigin() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reconcile this with @varconst-fb since this will be a public API.

Copy link
Contributor Author

@zxu123 zxu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Should I port absl::optional? If so, I'll do it in a separate PR and then address the change here.

#ifndef FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_
#define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_GEO_POINT_H_

#include <string.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

/** Immutable class representing a GeoPoint in Firestore */
class GeoPoint {
public:
GeoPoint();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Explicitly makes those default; frankly speaking, I don't aware any compiler that will omit those default in our case here.

  GeoPoint(const GeoPoint& other) = default;
  GeoPoint(GeoPoint&& other) = default;
  GeoPoint& operator=(const GeoPoint& other) = default;
  GeoPoint& operator=(GeoPoint&& other) = default;

public:
GeoPoint();

GeoPoint(double latitude, double longitude);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


#include "Firestore/core/include/firebase/firestore/geo_point.h"

#include <math.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isnan in math.h. The other std library is not used and removed.

}

Blob Blob::CopyFrom(const uint8_t* source, size_t size) {
uint8_t* copy = new uint8_t[size];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not always copying; it always takes ownership a.k.a. either make a copy and take ownership of that copy (by calling CopyFrom) or directly take the passing-in's ownership and not make a copy (by calling MoveFrom). There is no way to achieve the MoveFrom(const uint8_t* source, size_t size) via std::vector.

}

bool operator<(const Blob& lhs, const Blob& rhs) {
int comparison =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

inline bool operator!=(const Blob& lhs, const Blob& rhs) {
return lhs < rhs || lhs > rhs;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. reimplemented. cannot use vector, see comment above.

default: {} // The other types where there is nothing to worry about.
}
tag_ = type;
// Must call constructor explicitly for any non-POD type to initialize.
switch (tag_) {
case Type::Timestamp:
new (&timestamp_value_) Timestamp(0, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM. I think we may want a document to record the diversion of C++ implementation and ObjC implementation; here the default ctor behavior of Timestamp is one. This way may help people avoid making certain type of mistake like replace the construct of Timestamp but forgot to initialize with Now.

case Type::ServerTimestamp:
// We initialize them to origin to avoid expensive calls to get `now'.
new (&server_timestamp_value_)
ServerTimestamp{Timestamp::Origin(), Timestamp::Origin()};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Timestamp::Timestamp() : seconds_(time(nullptr)), nanos_(0) {
}

bool Timestamp::IsOrigin() const {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll port abseil's optional in a separate PR. @wilhuff any comment on porting abseil's optional? The port only introduce additional:

  • absl/memory/memory.{h,cc},
  • absl/base/macros.{},
  • absl/base/port.h,
  • absl/base/attributes.,
  • abs/base/config.,
  • abs/base/optimization.,
  • abs/utility/utility.,
  • absl/base/internal/invoke.h,
  • absl/types/bad_optional_access.h,

absl::optional might be also useful for other part of the C++ code due to the lack of mechanism of C++ to allow value types being null.

@zxu123 zxu123 self-assigned this Jan 24, 2018

#include "Firestore/core/include/firebase/firestore/geo_point.h"

#include <math.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry missed that.

}

Blob Blob::CopyFrom(const uint8_t* source, size_t size) {
uint8_t* copy = new uint8_t[size];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you're saying is true (that we can't move from something else while using vector) but the reality is that the the public API is going to be firebase::Variant which has two kinds of values:

  • "mutable" blobs, whose values were allocated by the Variant
  • "static" blobs, whose values were passed by the caller and the caller still owns

You can't move from either of these:

  • In the "mutable" case the user has declared the variant to have a type of value and we can't change that type. Therefore the buffer is owned by the Variant.
  • In the "static" case we can't take control of the user buffer.

default: {} // The other types where there is nothing to worry about.
}
tag_ = type;
// Must call constructor explicitly for any non-POD type to initialize.
switch (tag_) {
case Type::Timestamp:
new (&timestamp_value_) Timestamp(0, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've done this in the past with "PORTING NOTE" in the comments of the class in question where there's a divergence.

https://github.com/firebase/firebase-js-sdk/search?utf8=%E2%9C%93&q=%22PORTING+NOTE%22&type=

namespace model {

TEST(Blob, Getter) {
Blob a = Blob::CopyFrom(reinterpret_cast<const uint8_t*>("\1\2\3"), 3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It would help the readability of these tests if you made little functions to hide these casts.

Something like

const uint8_t* Bytes(const char* value) { ... }
uint8_t* Bytes(char* value) { ... }

And perhaps the other direction too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

TEST(Blob, Copy) {
Blob a = Blob::CopyFrom(reinterpret_cast<const uint8_t*>("abc"), 4);
Blob b = Blob::CopyFrom(reinterpret_cast<const uint8_t*>("defg"), 5);
EXPECT_EQ(0, strcmp("abc", reinterpret_cast<const char*>(a.get())));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use EXPECT_STREQ() instead of EXPECT_EQ(0, strcmp())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

EXPECT_EQ(Type::Double, nan_value.type());
EXPECT_EQ(Type::Long, integer_value.type());
EXPECT_EQ(Type::Double, double_value.type());
EXPECT_TRUE(nan_value < integer_value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXPECT_LT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. Here we want explicitly show that we are testing the operator<, not depending on the assumption EXPECT_LT translates to operator<.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a safe assumption to make. Also it will give better error messages, but it's not that big of deal one way or the other.

Copy link
Contributor Author

@zxu123 zxu123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. PTAL.

}

Blob Blob::CopyFrom(const uint8_t* source, size_t size) {
uint8_t* copy = new uint8_t[size];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the discussion went too far on the Blob for implementing FieldValue type. Since CPU cost is not a main concern as in our OKR discussion for now while code size and complexity is the main concern, let me just use the std::vector<uint8_t> in FieldValue. There is no point to wrap around a std::vector<uint8_t> via a Blob here as all the Blob API in the end is simply dedicated to std::vector API calls.

default: {} // The other types where there is nothing to worry about.
}
tag_ = type;
// Must call constructor explicitly for any non-POD type to initialize.
switch (tag_) {
case Type::Timestamp:
new (&timestamp_value_) Timestamp(0, 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

namespace model {

TEST(Blob, Getter) {
Blob a = Blob::CopyFrom(reinterpret_cast<const uint8_t*>("\1\2\3"), 3);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

TEST(Blob, Copy) {
Blob a = Blob::CopyFrom(reinterpret_cast<const uint8_t*>("abc"), 4);
Blob b = Blob::CopyFrom(reinterpret_cast<const uint8_t*>("defg"), 5);
EXPECT_EQ(0, strcmp("abc", reinterpret_cast<const char*>(a.get())));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

EXPECT_EQ(Type::Double, nan_value.type());
EXPECT_EQ(Type::Long, integer_value.type());
EXPECT_EQ(Type::Double, double_value.type());
EXPECT_TRUE(nan_value < integer_value);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. Here we want explicitly show that we are testing the operator<, not depending on the assumption EXPECT_LT translates to operator<.

Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though we should start to think about porting some of the test helpers to C++ so that we can cut down on the verbosity of instantiating object values and the like.

I'd suggest that we can probably follow the Android port more closely, though we need to decide if we want the helpers to remain free functions or what.

/** Immutable class representing a GeoPoint in Firestore */
class GeoPoint {
public:
GeoPoint();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I should have been clearer in what I meant.

I agree that no compiler would omit these today. However, should we accidentally make a change to this class that made it not trivially copyable then we might not realize it before we broke our customers. If you include these declarations and the compiler cannot generate the default implementations because we've made such a change it will fail the build.

Since this is a public API I'm advocating that it's worth it to protect us from ourselves :-).

}

Blob Blob::CopyFrom(const uint8_t* source, size_t size) {
uint8_t* copy = new uint8_t[size];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a reasonable conclusion.

EXPECT_EQ(Type::Double, nan_value.type());
EXPECT_EQ(Type::Long, integer_value.type());
EXPECT_EQ(Type::Double, double_value.type());
EXPECT_TRUE(nan_value < integer_value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a safe assumption to make. Also it will give better error messages, but it's not that big of deal one way or the other.

@zxu123 zxu123 merged commit bfa0e40 into master Jan 25, 2018
@zxu123 zxu123 deleted the cpp/fieldvaluesss branch January 25, 2018 14:14
rsgowman added a commit that referenced this pull request Mar 8, 2018
* Version bump for 4.8.1 Release

Updated the version numbers of pods which are being released in 4.8.1

* Update from master

Picking up a few last-minute changes to CHANGELOGs and tests for 4.8.1
release.

* Update Core info for M21.1

Update missing version bump for M21.1 for FirebaseCore.

* Remove over-aggressive assert.

closeWithFinalState: assumes delegate != nil, but that is not true if when
startWithdelegate: was called we entered backoff (performBackoffWithDelegate:)
and so self.delegate did not get assigned yet.

We could rework the code to make the assertion hold, but per offline
discussion this assert doesn't represent an invariant that we care about
and so I'm just removing it.

* Remove over-aggressive closeWithFinalState: delegate assert. (#656)

Fixes #596. closeWithFinalState: asserted delegate != nil, but that is not true if when
startWithdelegate: was called we entered backoff (performBackoffWithDelegate:)
and so self.delegate did not get assigned yet.

We could rework the code to make the assertion hold, but per offline
discussion this assert doesn't represent an invariant that we care about
maintaining and so I'm just removing it.

* Increase FirebaseAuth version for M21.1

This version was missed in the M21.1 version bump PR.

* Fix import formatting (#660)

* Fix issue @morganchen12 discovered where we weren't properly creating FIRQueryDocumentSnapshot instances. (#662)

* Validate clang-format compliance in travis (#648)

* Build gRPC for Firestore C++ (#652)

* Clean up quoting and other minor issues

* Reorganize CMake build output

Make it clearer which parts of the output pertain to external projects.

* Use a consistent ordering of ExternalProject arguments

* Prevent the top-level build from running in parallel

This prevents spurious failures when running make -j.

* Actually parse arguments in the xcodebuild function

* Use ExternalProject features when available

  * submodule limits from CMake 3.0
  * shallow clones from CMake 3.6
  * git progress output from CMake 3.8

* Only build the parts of leveldb we need

Skip building the tools and other libraries

* Avoid installing ExternalProjects

Consume build output directly so that we can build just the targets we
need. Installing causes all targets to be built.

This doesn't matter as much for these targets but the gRPC build
includes a ton of stuff we don't need so it's worth adopting this as a
general strategy.

* Define an external build for grpc

* Test that grpc can link successfully.

* Add a FindGRPC CMake module

* Actually comment ExternalProjext_GitSource

* Inject infoDictionary to fix flakey tests. (#664)

* Inject infoDictionary to fix flakey tests.

* Remove outdated comment, update format.

* Fix issue @morganchen12 discovered where we weren't properly creating FIRQueryDocumentSnapshot instances. (#662)

* Travis - run tests only for changed code (#665)

* Add assert_test to the Xcode build (#671)

* Exclude stdio-backed assert from the Xcode build

* Add assert_test to the Xcode build

* Enable warnings in the CMake build (#669)

* Enable warnings when building with GCC or clang

* Fix warnings

* Fix C++ lint errors (#668)

* Misc style.sh fixes

  * Allow test-only to use a revision; to check your changes since
    master:

    ./scripts/style.sh test-only master
  * Avoid diffing deleted files
  * 80 columns

* Fix C++ lint errors

* implement FieldValue for null, boolean, and array in C++. (#637)

* implement FieldValue for null and boolean.

* refactoring to use union type instead of poly

* refactor using union design intead of poly

* refactoring to use anonymous union and fix styles

* small fix

* add field_value_test to the project

* fix warning of cmake and fix style

* Simplify integration with googletest (#672)

This makes it possible to build the Firestore subproject with CLion
because it no longer needs to be told where googletest is.

* Add a cc_library to the CMake build (#670)

* Rewrite cc_test to take named arguments

Cut down on build file verbosity by having cc_test take SOURCES and
DEPENDS. The separate invocation of target_link_libraries is no longer
necessary.

* Add a cc_library rule to parallel cc_test

This cuts down on build file verbosity.

* Automatically add OBJC_FLAGS to cc_libraries if applicable

* Exclude platform-specific libraries from 'all'

This is makes it possible to declare this kind of library
unconditionally. Usage within a test or as a dependency will actually
trigger building.

* Restore secure_random_test.cc; clean-up comments

* Fix CMake build and lint warnings in field_value.cc (#677)

Fixes these cpplint warnings:

Firestore/core/src/firebase/firestore/model/field_value.cc:162:  Semicolon defining empty statement. Use {} instead.  [whitespace/semicolon] [5]
Firestore/core/src/firebase/firestore/model/field_value.cc:170:  Semicolon defining empty statement. Use {} instead.  [whitespace/semicolon] [5]
Firestore/core/src/firebase/firestore/model/field_value.cc:126:  Add #include <utility> for swap  [build/include_what_you_use] [4]

* Listen sequence numbers (#675)

* Generate and save sequence numbers for listens

* Add documentation

* Fix include path

* Fix unavailable comment

* Review feedback

* Fix build warnings by making void parameter explicit (#681)

* Add platform detection logic for SecureRandom (#676)

* Add CMake platform detection logic for SecureRandom

Now only builds secure_random_arc4random.cc if available.

Remove firebase/firestore/base/port.h. Nothing else was in that
directory.

* Add a SecureRandom implementation that uses OpenSSL

This is usable on Linux, Windows, and Android

* Properly check return from RAND_bytes

* Port comparison to C++ (#678)

This reimplements our comparison functions as C++ Comparators and then provides compatibility shims for interoperating with existing Objective-C usage.

A few specialized comparators aren't suitable for porting but only have a single usage (e.g. CompareBytes for comparing NSData * instances). In these cases I've moved them into the caller.

* Use int32_t for typeof(ID) in FSTDocumentReference

* Migrate callers of FSTComparison.h to Objective-C++

* Port comparison to C++

* Migrate usages of FSTComparison.h to C++ equivalents

* Remove FSTComparison

* Use Comparator in FieldValue. (#686)

* style.sh - output unformatted files in test-only and ignore generated config.h (#690)

* Cleanup imports and isEqual (#685)

* Fix headers

* Fix isEqual verbosity

* Fix isEqual for nullable properties

* Fix nullability on FSTTestDocSnapshot

* Fixing spelling error in FIRStorageErrors

* Update travis to use CocoaPods 1.4.0 (#692)

* add FIRUser behavior to documentation

* Disable Messaging build warnings (#697)

* Update FirebaseMessaging protos (#696)

* Adding enable/disable property to FCM token auto Initialization

* revert unrelated changes

* revert unrelated changes

* revert unrelated changes

* Adds explicit core graphics dependency to auth (#700)

* Properly publish Abseil sources as a part of the podspec (#704)

* Properly include abseil sources
* Exclude abseil tests

* Implement the rest of FieldValue types for C++ (#687)

* implement FieldValue for null and boolean.
* Implement number and string FieldValue.
* Implement object FieldValue.
* implement timestamp FieldValue.
* Implement number and string FieldValue.
* implement public type `Blob` and `GeoPoint`
* implement Blob FieldValue
* Implement GeoPoint FieldValue
* refactoring `Blob`

* README - FirebaseCore source pod must be included with all source pods (#705)

* Fix incorrect deprecation message (#688)

* Fix incorrect deprecation message for Obj-C and Swift

* Update CHANGELOG for M21.1 release (#679)

* normalize string_util (#708)

* refactoring string_util
* port string_util to iOS

* implement `TargetIdGenerator` in C++ for Firestore (#701)

* implement `TargetIdGenerator`

* address changes

* adding unit test for auto init enable function (#710)

* port TargetIdGenerator to iOS (#709)

* port TargetIdGenerator to iOS

* fix style

* move pointer property to instance variable

* TriggerTravis

* normalize and port the rest of Firebase/Port code (#713)

* normalize bits
* normalize ordered_code

* Fix b/72502745: OnlineState changes cause limbo document crash. (#470) (#714)

[PORT OF firebase/firebase-js-sdk#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.

* travis: check for copyright in sources (#717)

* Add the C++ linter to the repo (#720)

* 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

* Version updates to 4.8.2 (#722)

* Use fixed-sized types (#719)

Should have caught this during review, but cpplint caught it

*  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

* Add changelog entry for my last PR (oops) and also add a few that we missed last release. (#724)

* Add absl_strings to firebase_firestore_util_test dependencies (#725)

Required to link the test on rodete.

* Firestore DatabaseId in C++ (#727)

* Implement DataBaseId in C++

* add database_id_test to project

* fix project

* address changes

* fix style

* 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

* [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

* Fix tests.

* 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

* Start on ArraySortedMap in C++ (#721)

* Implement ArraySortedMap.remove
* Implement ArraySortedMap.insert
* Ensure ArraySortedMap.insert avoids copying on duplicates
* Port more ArraySortedMapTests

* 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.

* Align tests and integration test header search paths (#737)

* fix (#739)

* 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.

* fix null block execution crash

* Make sure Firestore/core/include is in the podspec (#748)

* 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.)

* Add ability to build nanopb and protobuf

* Add instructions for building nanopb protos

Currently only supported on osx

* Add generated nanopb protos.

100% machine generated (except adding of the license).

* Import "well-known" protos (and generated nanopb files)

For use by nanopb (which otherwise doesn't know what to do with these.)

* 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.

* style.sh now ignores generated nanopb files

* ./style.sh

* 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.)

* Downgrade nanopb from 0.4.0-dev to 0.3.8.

Also regenerate the protos

* Minor refactoring

* Ignore trailing whitespace in autogenerated nanopb files

* Update abseil-cpp to a new upstream (#754)

Update to bf7fc9986e20f664958fc227547fd8d2fdcf863e

* Add StrCat, StrJoin and the rest of //strings from abseil-cpp (#756)

From abseil-cpp version bf7fc9986e20f664958fc227547fd8d2fdcf863e

* 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.

* Fix firebaes typo (#755)

* 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

* C++ port: port FSTFieldPath and FSTResourcePath to C++ (#749)

Similar to Objective-C, FieldPath and ResourcePath share most of their interface (and implementation) by deriving from BasePath (using CRTP, so that factory methods in BasePath can return an instance of the derived class).

* Creating CHANGELOG for FCM (#764)

* add CHANGELOG for FCM

* fix the typo

* avoid using initWithSuiteName which does not support iOS 7 (#765)

* Updates version of Firebase Auth in Changelog (#771)

* Updates version of Firebase Auth in Changelog

* addresses comments

* Update CHANGELOG for Firestore v0.10.1 (#768)

* Explicitly specify the default constructor to FieldPath (#773)

Xcode prior to 8.3 does not accept an explicitly defaulted constructor
(`= default`) for the purposes of default initializing a const object.

This fixes a build failure under Xcode 8.2:

```
Firestore/core/src/firebase/firestore/model/field_path.cc:144:26: error: default initialization of an object of const type 'const firebase::firestore::model::FieldPath' without a user-provided default constructor
  static const FieldPath empty_path;
```

* Update deprecation message for Firestore. (#758)

* Update FIRFirestore.h

* Provide full command to enable debugging.

* Version bumps for 4.9.0 (#774)

* cmake build fixes (#770)

* Fix nanopb (in cmake build)

Look for binaries in the src dir (since that's where we build now.) This
error would be masked if a previous build had completed prior to
switching nanopb to build out of src.

Also, don't patch the protoc path multiple times. This could be
triggered by (eg) 'make && make clean && make'.

* Add resource_path.{h,cc} to the cmake build

* Fix signed/unsigned int comparison warnings

* Ensure FieldValue tag_ is initialized during cp/mv ctor.

Otherwise, the assignment operator attempts to deallocate based on the
(uninitialized) tag_ variable, posssibly leading to segfaults.

* Fix tests that throw exceptions.

The (previous) tests checked to ensure that an abort() occurs, but if
ABSL_HAVE_EXCEPTIONS is defined on non-macos (which is currently the
default) then the assertions will throw a std::logic_error rather than
abort()ing.

On macos, an exception is thrown too, but the exception doesn't derrive
from std::exception, so ASSERT_DEATH_* doesn't catch it (hence why
ASSERT_DEATH_* actually works.)

To resolve this, I've switched to ASSERT_ANY_THROW.

* Let Travis run for `CMake` test and `lint.sh` (#769)

* Fix nanopb (in cmake build)

Look for binaries in the src dir (since that's where we build now.) This
error would be masked if a previous build had completed prior to
switching nanopb to build out of src.

Also, don't patch the protoc path multiple times. This could be
triggered by (eg) 'make && make clean && make'.

* Add resource_path.{h,cc} to the cmake build

* Fix signed/unsigned int comparison warnings

* let Travis run for `CMake` test and `lint.sh`

* Ensure FieldValue tag_ is initialized during cp/mv ctor.

Otherwise, the assignment operator attempts to deallocate based on the
(uninitialized) tag_ variable, posssibly leading to segfaults.

* address change

* fix trailing space

* address change

* moving Firestore checks closer together

* Fix tests that throw exceptions.

The (previous) tests checked to ensure that an abort() occurs, but if
ABSL_HAVE_EXCEPTIONS is defined on non-macos (which is currently the
default) then the assertions will throw a std::logic_error rather than
abort()ing.

On macos, an exception is thrown too, but the exception doesn't derrive
from std::exception, so ASSERT_DEATH_* doesn't catch it (hence why
ASSERT_DEATH_* actually works.)

To resolve this, I've switched to ASSERT_ANY_THROW.

* ./scripts/lint.sh

* Move FieldValue::tag_ initializer to be in class.

* check Travis ulimit

* check travis limit

* set make -j 200 instead of unlimited

* use cpu core number instead of 200

* port Firestore Auth module in C++ (#733)

* Implement firestore/auth/user

* add user to project and some fixes

* implement firestore/auth/{credentials_provider,empty_credentials_provider}

* implement firestore/auth/firebase_credentials_provider

* refactoring firebase_credentials_provider and add (disabled but working) unit test

* add auth test to project

* address changes

* small fix to style and project

* fix the firebase_credentials_provider_test

* fix style

* address changes

* revert the change to static mutex_

* remove my custom plist path

* fix style

* address changes

* refactoring FirebaseCredentialsProvider to fix the issue w.r.t. auth global dispatch queue

* add /*force_refresh=*/ tag to bool literal for style purpose

* Use a shared_ptr/weak_ptr handoff on FirebaseCredentialsProvider (#778)

* Revert "refactoring FirebaseCredentialsProvider to fix the issue w.r.t. auth global dispatch queue"

This reverts commit 87175a4.

* Use a shared_ptr/weak_ptr handoff on FirebaseCredentialsProvider

This avoids any problems with callsbacks retaining pointers to objects
destroyed by a C++ destructor

* port Firestore SnapshotVersion in C++ (#767)

* implement SnapshotVersion and test

* Fix Core CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warnings (#779)

* C++ port: add C++ equivalent of FSTDocumentKey. (#762)

Also move kDocumentKeyPath to the only point of usage - make it a static
member variable of FieldPath.

* Strawman C++ API (#763)

Incomplete, and what does exist in still slightly vague. It's expected
that this will change.

* Move to explicit nil check. (#782)

* Update FieldValue of type Reference (#775)

* update FieldValue of type Reference

* address change

* fix bad path string literal in test

* use ReferenceValue and qualified name

* Port Firestore Document to C++ (#777)

* implement SnapshotVersion and test

* update project

* implement MaybeDocument and test

* move snapshot-version from core to model

* fix a bug

* implement Document and test

* implement NoDocument

* adding type tag and fix style

* fix a few bugs, discovered after merging and test run.

* add assert to check FieldValue type and more test for comparision.

* address changes

* allow moving FieldValue to construct Document.

* address changes

* add document tests to project

* use std::less convention

* make Type::Unknown static initializer

* Cleaning up implicit retain for the RTDB and Storage

* Fix double parsing on 32 bit devices. (#787)

* Keep track of number of queries in the query cache (#776)

* 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

* Split add and update queryData

* Work on adding targetCount

* More work on count

* Using shared_ptr

* Implement count for query cache

* use quotes

* Add cast

* Styling

* Revert year bump in copyright

* Add adversarial key to migration test

* Add comment

* Fix style

* style fix

* fix flaky test (#788)

* Fix off-by-one error in Auth changelog (#789)

* Serialize and deserialize null (#783)

* Build (grpc's) nanopb with -DPB_FIELD_16BIT

We require (at least) 16 bit fields. (By default, nanopb uses 8 bit
fields, ie allowing up to 256 field tags.)

Also note that this patch adds this to grpc's nanopb, rather than to our
nanopb. We'll need to eventually either:
a) we instruct grpc to use our nanopb
b) we rely on grpc's nanopb instead of using our own.

(^ marked as a TODO for now.)

* Add some dependant protos

Imported from protobuf. Nanopb requires these to be present (though
anything using libprotobuf does not, as these are already built into
that.)

* Add generated nanopb protos based off of newly added proto definitions

* Build the nanopb protos

* Serialize and deserialize null

* Actually ignore events on inactive streams, rather than just logging that we're going to. (#790)

* Improve documentation on auto-init property in FCM. (#792)

* Fixed capitalization of init in test function. (#797)

* Update README.md with code markup (#800)

Add code markup to a few paths for consistency.

* replacing Auth/FSTUser by C++ auth implementation (#804)

* replacing Auth/FSTUser by C++ auth implementation

* address changes

* DispatchQueue delayed callback improvements + testing (#784)

Basically a port of firebase/firebase-js-sdk@a1e346f and firebase/firebase-js-sdk@fce4168

* 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.

* Enable -Wcomma for our build; disable it for abseil. (#799)

In order to use different cflags for abseil, this patch splits it out
into a subspec within the pod.

The cmake side of things "just works" since Firestore/CMakeLists.txt
includes abseil before setting our compiler flags.

* Serialize (and deserialize) bool values (#791)

* Require official 1.4.0 for min CocoaPods version (#806)

* Disable -Wrange-loop-analysis for abseil (#807)

absl includes code like this:
```
void fn(std::initializer_list<absl::string_view> pieces) {
  ...
  for (const absl::string_view piece : pieces) total_size += piece.size();
```

clang objects, suggesting that a reference should be used instead, i.e.:
```
  for (const absl::string_view& piece : pieces) total_size += piece.size();
```

But:
a) we don't want to touch absl code
b) string_views are cheap to copy (and absl recommends copying
string_views rather than taking references as it may result in smaller
code)
c) some brief, naive benchmarking suggests there's no significant
different in this case (i.e. (b) is correct.)

Note that -Wrange-loop-analysis is already exlicitly enabled in our
cmake build.

* Delete stale Firestore instances after FIRApp is deleted. (#809)

* replacing FSTGetTokenResult by C++ Token implementation (#805)

* replacing Auth/FSTUser by C++ auth implementation

* address changes

* replacing FSTGetTokenResult by C++ Token implementation

* address changes

* address changes

* fix another const& v.s. dispatch bug

* fix more const& v.s. dispatch bug  zxu123 committed

* fix

* passing by value in callback

* Fix two stream close issues (b/73167987, b/73382103). (#810)

* Fix b/73167987: Upon receiving a permanent write error when we had additional
  pendingWrites to send, we were restarting the stream with a new delegate and
  then immediately setting the delegate to nil, causing the stream to ignore
  all GRPC events for the stream.
* Fix b/73382103: We were attempting to gracefully teardown the write stream (i.e.
  send an empty WriteRequest) even when the stream was already failed due
  to an error. This caused no harm other than log pollution, but I fixed it.
* Use -[GRPCCall setResponseDispatchQueue] to dispatch GRPC callbacks directly onto the Firestore worker queue. This saves a double-dispatch and simplifies our logic.
* Add stricter assertions regarding stream state now that dispatch queue / callback filter race conditions are eliminated.

* [En|De]codeUnsignedVarint -> [En|De]codeVarint (#817)

* [En|De]codeUnsignedVarint -> [En|De]codeVarint

The 'unsigned' portion was misleading, as these varints work with both
signed and unsigned integers. (The 'signed' varints also work with both
signed and unsigned integers, but use zig-zag encoding so that negative
numbers are encoded more efficiently. Note that 'signed' varints aren't
used in the Value proto, so won't appear in the serializer class for at
least the short term.)

Added some docstrings to help disambiguate this.

* 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).

* Fix implicit retain self warnings (#808)

Xcode has starting warning about us implicitly retaining self references
within blocks. This commit fixes it by explicitly mentioning self. No
real changes are introduced here; this is effectively just making
implicit behaviour explicit.

* Accept FIRTimestamp where NSDate is currently accepted as a parameter (#823)

* Fix trivial mem leak in the test suite (#828)

Reduces noise while running valgrind so that I can see the leaks that
I'm introducing. :/

* Serialize (and deserialize) int64 values (#818) (#829)

*  Avoid wrapping and rewrapping NSStrings when constructing DatabaseId (#833)

* Avoid wrapping and rewrapping NSStrings when constructing DatabaseId

* Shorten DatabaseId::kDefaultDatabaseId

* Fix Firestore tests for M22 (#834)

* Add FIRFirestoreTests to the Firestore Xcode project

* Avoid waitForExpectations:timeout:

This API was added in Xcode 8.3, but we still build production releases
with Xcode 8.2. waitForExpectationsWithTimeout:handler: is available
from Xcode 7.2.

* Add AppForUnitTesting

Add a utility for constructing a Firebase App for testing.

* Handle the nil UID from FIRAuth

* Avoid running CMake tests twice

* Only build app_testing on Apple platforms

* Revise test.sh messages

* Avoid warnings about failing to override a designated initializer (#832)

* address PR comments

* Refactor [En|De]codeVarint to be symetric wrt tags (#837)

Since we can't decode a value before knowing it's type, I've pulled the
tag handling out of these methods.

More context over here:
#829

* Fix lint warnings (#840)

* Don't build firebase_firestore_testutil_apple on non-apple platforms. (#841)

Was failing the cmake build on linux.

* Initial Carthage distribution instructions (#821)

I couldn't find a way to get the Carthage installer to install Resources, so withdrawing Firestore and Invites. The other 11 components passed testing.

* Update CHANGELOG for release (#845)

* improve the documentations on auto init property

* adjust the comments

* Add build infrastructure for Codable support in Firestore (#815)

* Add Firestore_SwiftTests_iOS target to Xcode

* Add FirebaseFirestoreSwift podspec

* Add Firestore_SwiftTests_iOS to the Podfile

* Add CodableGeoPoint and tests

* Version FirebaseFirestoreSwift separately

* Move -messageWasLogged to FIRTestCase

This makes it accessible to other test classes.

* Add third-party library version registration

This will allow us to collect the version of platform libraries that
developers use in conjunction with Firebase.

* Fixes clang warnings for Auth (#848)

* Fixes clang warnings for Auth

* Addresses comments

* Revert "Move -messageWasLogged to FIRTestCase"

This reverts commit dfda142.

* Add tests for useragent

Tests a variety of simple use cases.

* Auto-style swift sources (#847)

* Fix bash style issues

* Exclude additional build output directories

* Format swift files with scripts/style.sh

* Reformat swift sources

* Allow swiftformat 0.32.0 on travis

* PR feedback

* Add FirebaseCore version reporting

I've also added clearing of the library names for tests to avoid the
auto found versions on load.

* Deflake tests

* Updating RTDB Changelog for v4.1..5

* Update CHANGELOG.md

* Style fixes

* Change library name

* Update CHANGELOG.md

* Update CHANGELOG.md

* Add XCode and Apple SDK versions

* Update CHANGELOG for Firestore v0.10.2 (#856)

* Manually fix clang-format issues

* Remove unnecessary nonnull annotations

* Update changelog for release (#857)

* Updates changelog in preparation for release

* Adds another change.

* Update Core CHANGELOG for 4.0.16 (#858)

* Convert cmake build to (mostly) use urls rather than git clones (#852)

Exception: grpc. Due to it's use of git submodules, it's not completely trivial to convert it (though probably wouldn't be too much more work.)

This helps address our build being throttled. (Maybe. This assumes github allows more fetching of tgz's than clones.) It should also speed up our build times.

The downloaded tarballs are placed into ${PROJECT_BINARY_DIR}/downloads. This allows for eventual caching in travis.

* Eliminate TypedValue and serialize direct from FieldValue to bytes. (#860)

This will likely only apply for proto messages that use 'oneof's. (Because we need to serialize these manually.)

The problem was that as we were adding additional types, TypeValue was evolving into a parallel implementation of the FieldValue union.

When serializing/deserializing oneofs we need to supply a custom value to serialize and a custom function to do the work. There's no value in translating from FieldValue to TypeValue just to store as this custom object. We might as well just store the FieldValue model directly and write the custom serializer/deserializer to use the model directly.

* replacing Auth by C++ auth implementation (#802)

* lazy replacing FST(Firebase)CredentialsProvider by (Firebase)CredentialsProvider

* lazy replacing FSTUser by User

* adding error-code parameter to TokenListener

* actually use const user& instead of pointer; also add an error util

* add HashUser and pass into the unordered_map

* use User in test

* use c++ CredentialsProvider and subclass in test

* fix unit test

* use explicit capture in lambda instead of capture all by reference

* cache currentUser explicitly when reset sync engineer test driver

* objc object should be captured by value in lambda

* replacing Auth/FSTUser by C++ auth implementation

* address changes

* replacing FSTGetTokenResult by C++ Token implementation

* address changes

* fix unintentional change in merging

* patch the change in objc Auth up-stream

* somehow, the lambda-version of set-user-change-listener does not work... fallback to block

* address changes

* fix another const& v.s. dispatch bug

* fix more const& v.s. dispatch bug  zxu123 committed

* fix a bad sync line

* address changes

* address change

* address change

* fix upstream change from merge

* fix upstream changes

* Suggested fixes for cpp/port_auth (#846)

* Get rid of MockDatastore factory

This avoids the need to statically allocate (and leak) a credentials
provider

* Use absl::make_unique

std::make_unique technically does not exist until C++14.

* #include <utility> for std::move

* Use std::future for the initial user

* fix style

* Add FieldValue.boolean_value() (#862)

* style.sh (for swift)

* remove forward declarations for classes that no longer exist
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg@google.com>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang@google.com>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg@google.com>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg@google.com>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg@google.com>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis@google.com>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu@google.com>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman@google.com>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg@google.com>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg@google.com>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien@google.com>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman@google.com>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien@google.com>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu@google.com>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu@google.com>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang@google.com>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu@google.com>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu@google.com>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan@google.com>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu@google.com>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg@google.com>

ORIGINAL_AUTHOR=Gil <wilhuff@github.com>
PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg@google.com>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang@google.com>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg@google.com>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg@google.com>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg@google.com>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis@google.com>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu@google.com>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman@google.com>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg@google.com>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg@google.com>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien@google.com>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman@google.com>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien@google.com>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu@google.com>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu@google.com>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang@google.com>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu@google.com>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu@google.com>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan@google.com>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu@google.com>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg@google.com>

PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg@google.com>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang@google.com>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg@google.com>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg@google.com>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg@google.com>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis@google.com>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu@google.com>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman@google.com>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg@google.com>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg@google.com>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien@google.com>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman@google.com>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien@google.com>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu@google.com>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu@google.com>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang@google.com>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu@google.com>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu@google.com>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan@google.com>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu@google.com>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg@google.com>

ORIGINAL_AUTHOR=Gil <wilhuff@github.com>
PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg@google.com>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang@google.com>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg@google.com>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg@google.com>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg@google.com>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis@google.com>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu@google.com>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman@google.com>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg@google.com>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg@google.com>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien@google.com>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman@google.com>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien@google.com>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu@google.com>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu@google.com>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang@google.com>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu@google.com>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu@google.com>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan@google.com>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu@google.com>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg@google.com>

ORIGINAL_AUTHOR=Gil <wilhuff@github.com>
PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg>

ORIGINAL_AUTHOR=Gil <wilhuff@github.com>
PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg>

ORIGINAL_AUTHOR=Gil <wilhuff@github.com>
PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg>

ORIGINAL_AUTHOR=Gil <wilhuff@github.com>
PiperOrigin-RevId: 184568931
zxu123 pushed a commit to zxu123/firebase-ios-sdk that referenced this pull request May 23, 2018
--
197713382 by zxu <zxu>:

Implement more on listener class and implement ListenerRegistration.

TESTED:
blaze test //sensored/testapp:testapp_build_test
blaze test //sensored/testapp:testapp_build_test --config=android_x86
blaze test //sensored/testapp:android_testapp_test --config=android_x86 --define firebase_build=stable
blaze test //sensored/cpp:firestore_kokoro
blaze test //sensored/cpp:listener_registration_test
--
196551381 by zxu <zxu>:

Implement more on listener class and implement the DocumentReference::AddSnapshotListener.

Also added a few test case and fixed a bug in DocumentReferenceInternal.

ListenerRegistration will be implemented in subsequent CL.

TESTED:
blaze test //sensored/testapp:testapp_build_test
blaze test //sensored/testapp:testapp_build_test --config=android_x86
blaze test //sensored/testapp:android_testapp_test --config=android_x86 --define firebase_build=stable
blaze test //sensored/cpp:firestore_kokoro
blaze test //sensored/cpp:firestore_test
--
196276752 by zxu <zxu>:

Implement the SnapshotMetadata with inline methods and (non-)Wrapper for Firestore C++.

TESTED:
blaze test //sensored/testapp:testapp_build_test
blaze test //sensored/testapp:testapp_build_test --config=android_x86
blaze test //sensored/testapp:android_testapp_test --config=android_x86 --experimental_one_version_enforcement=warning
blaze test //sensored/cpp:firestore_kokoro
blaze test //sensored/cpp:firestore_test
--
195841793 by zxu <zxu>:

Implement the wrapper class for callback (EventListener).

People unlike huge CL. So sending this short one for review. In subsequent CLs, I'll do:
*   cache/uncache or the CppEventListener class and the wiring of native method;
*   actually using this to implement DocumentReference::AddSnapshotListener;
*   update the testapp to run android_test with callback.
--
194112388 by zxu <zxu>:

Add Android-Wrapper for DocumentReference's non-callback methods.

Tested:
blaze test //sensored/testapp:testapp_build_test
blaze test //sensored/testapp:testapp_build_test --config=android_x86
blaze test //sensored/cpp:firestore_kokoro
blaze test //sensored/cpp:firestore_test
--
192445183 by zxu <zxu>:

Add Android-Wrapper for Firestore's remaining methods.
Tested:
blaze test //sensored/testapp:testapp_build_test
blaze test //sensored/testapp:testapp_build_test --config=android_x86
blaze test //sensored/cpp:firestore_kokoro
blaze test //sensored/cpp:firestore_test
--
190986604 by mcg <mcg>:

Manually import the public portion of

  - 22c226a C++ migration: make Timestamp class a part of public API ... by Konstantin Varlamov <var-const@users.noreply.github.com>

Note that this only imports the header, which otherewise won't come over with a
regular copybara run because we're currently excluding the public headers from
the Firestore import with cl/188810622.

The .cc implementation of this will come over with a regular copybara import,
coming shortly.
--
189013767 by zxu <zxu>:

Add Android-Wrapper for Firestore's method that does not involve other Firestore types.
Tested:
blaze test //sensored/testapp:testapp_build_test
blaze test //sensored/testapp:testapp_build_test --config=android_x86
blaze test //sensored/cpp:firestore_kokoro
--
188809445 by mcg <mcg>:

Import of firebase-ios-sdk from Github.

  - 07f4695 Updates Changelog for 4.5.0 release (firebase#908) by Zsika Phillip <protocol86@users.noreply.github.com>
  - 2b82a2e Allow serializing arbitrary length FieldValues (firebase#889) by rsgowman <rgowman>
  - 3e41f25 Fix test failures that occur during prod build (firebase#910) by rsgowman <rgowman>
  - f122cf7 Fix MutationQueue issue resulting in re-sending acknowled... by Michael Lehenbauer <mikelehen@gmail.com>
  - 7522314 Partial wrapping of pb_ostream_t (pt2) (firebase#903) by rsgowman <rgowman>
  - 0d3adb1 Partial wrapping of pb_ostream_t (pt1) (firebase#899) by rsgowman <rgowman>
  - e41f4b1 Merge Release 4.10.1 into Master (firebase#896) by zxu <zxu>
  - 2ae36f1 [De]Serialize FieldValue map_values ("Objects") (firebase#878) by rsgowman <rgowman>
  - 5930ad2 Factor out a universal build script (firebase#884) by Gil <mcg>
  - 8ef0f14 Adds Email link sign-in (firebase#882) by Paul Beusterien <paulbeusterien>
  - 0b8f216 Merge pull request firebase#880 from firebase/release-4.10.0 by Paul Beusterien <paulbeusterien>
  - 8311c64 port paths to FSTDocumentKey (firebase#877) by zxu <zxu>
  - 34ebf10 Add 10 second timeout waiting for connection before clien... by Michael Lehenbauer <mikelehen@gmail.com>
  - 1c40e7a add converters and port paths to FSTQuery (firebase#869) by zxu <zxu>
  - 9b5b4d8 Serialize (and deserialize) string values (firebase#864) by rsgowman <rgowman>
  - c6f73f7 Fix the issue completion handler is not triggered in subs... by Chen Liang <chliang>
  - 1ecf690 Add FieldValue.boolean_value() (firebase#862) by rsgowman <rgowman>
  - 3e7c062 replacing Auth by C++ auth implementation (firebase#802) by zxu <zxu>
  - 13aeb61 Eliminate TypedValue and serialize direct from FieldValue... by rsgowman <rgowman>
--
187049498 by mcg <mcg>:

Import of firebase-ios-sdk from Github.

  - f7d9f29 Fix lint warnings (firebase#840) by Gil <mcg>
  - b5c60ad Refactor [En|De]codeVarint to be symetric wrt tags (firebase#837) by rsgowman <rgowman>
  - ddc12c0 Merge pull request firebase#694 from morganchen12/auth-docs by Morgan Chen <morganchen12@gmail.com>
  - 442d46f Avoid warnings about failing to override a designated ini... by Gil <mcg>
  - 4dc63f8 Fix Firestore tests for M22 (firebase#834) by Gil <mcg>
  - 935f3ca  Avoid wrapping and rewrapping NSStrings when constructin... by Gil <mcg>
  - 6ce954a Serialize (and deserialize) int64 values (firebase#818) (firebase#829) by rsgowman <rgowman>
  - 41dcd4b Fix trivial mem leak in the test suite (firebase#828) by rsgowman <rgowman>
  - 50f9df9 Accept FIRTimestamp where NSDate is currently accepted as... by Konstantin Varlamov <var-const@users.noreply.github.com>
  - 67b068e Fix implicit retain self warnings (firebase#808) by rsgowman <rgowman>
  - 14ea068 Make FSTTimestamp into a public Firestore class (firebase#698) by Konstantin Varlamov <var-const@users.noreply.github.com>
  - de00de2 [En|De]codeUnsignedVarint -> [En|De]codeVarint (firebase#817) by rsgowman <rgowman>
  - 9bf73ab Fix two stream close issues (b/73167987, b/73382103). (firebase#8... by Michael Lehenbauer <mikelehen@gmail.com>
  - 7a4a2ea replacing FSTGetTokenResult by C++ Token implementation (... by zxu <zxu>
  - a9f3f35 Delete stale Firestore instances after FIRApp is deleted.... by Ryan Wilson <wilsonryan>
  - aa6f1ae Disable -Wrange-loop-analysis for abseil (firebase#807) by rsgowman <rgowman>
  - ef55eef Require official 1.4.0 for min CocoaPods version (firebase#806) by Paul Beusterien <paulbeusterien>
  - 7cddb97 Serialize (and deserialize) bool values (firebase#791) by rsgowman <rgowman>
  - 7a97f6c Enable -Wcomma for our build; disable it for abseil. (firebase#799) by rsgowman <rgowman>
  - 81ee594 DispatchQueue delayed callback improvements + testing (firebase#7... by Michael Lehenbauer <mikelehen@gmail.com>
  - fd9fd27 replacing Auth/FSTUser by C++ auth implementation (firebase#804) by zxu <zxu>
  - 6889850 Merge pull request firebase#801 from firebase/release-4.9.0 by Paul Beusterien <paulbeusterien>
  - e4be254 Fixed capitalization of init in test function. (firebase#797) by Ryan Wilson <wilsonryan>
  - 933be73 Improve documentation on auto-init property in FCM. (firebase#792) by Chen Liang <chliang>
  - 0f3c24b Actually ignore events on inactive streams, rather than j... by Greg Soltis <gsoltis>
  - fe19fca Serialize and deserialize null (firebase#783) by rsgowman <rgowman>
  - 95d0411 fix flaky test (firebase#788) by zxu <zxu>
  - b6613bd Cleaning up implicit retain for the RTDB and Storage by Sebastian Schmidt <mrschmidt>
  - 5f5f808 Keep track of number of queries in the query cache (firebase#776) by Greg Soltis <gsoltis>
  - c7c51a7 Fix double parsing on 32 bit devices. (firebase#787) by Ryan Wilson <wilsonryan>
  - 9504582 Port Firestore Document to C++ (firebase#777) by zxu <zxu>
  - adf9fb3 Update FieldValue of type Reference (firebase#775) by zxu <zxu>
  - 4afcfb1 Move to explicit nil check. (firebase#782) by Ryan Wilson <wilsonryan>
  - fd83e07 Strawman C++ API (firebase#763) by rsgowman <rgowman>
  - 8003348 C++ port: add C++ equivalent of FSTDocumentKey. (firebase#762) by Konstantin Varlamov <var-const@users.noreply.github.com>
  - 612d99c Fix Core CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warnings (#... by Paul Beusterien <paulbeusterien>
  - bf45a15 port Firestore SnapshotVersion in C++ (firebase#767) by zxu <zxu>
  - d70c23e port Firestore Auth module in C++ (firebase#733) by zxu <zxu>
  - 633eb7b Let Travis run for `CMake` test and `lint.sh` (firebase#769) by zxu <zxu>
  - 274fe52 cmake build fixes (firebase#770) by rsgowman <rgowman>
--
184568931 by mcg <mcg>:

Import of firebase-ios-sdk from Github.

  - 32266c5 Make sure Firestore/core/include is in the podspec (firebase#748) by Gil <mcg>
  - 070c0ea Merge pull request firebase#746 from morganchen12/unguarded-block by Morgan Chen <morganchen12@gmail.com>
  - 13f572e Increase expectation timeout to 25 seconds. (firebase#744) by Michael Lehenbauer <mikelehen@gmail.com>
  - 47d81fd fix (firebase#739) by Chen Liang <chliang>
  - 515625c Remove predecessorKey,Object,Document, etc (firebase#735) by Gil <mcg>
  - ac30522 Start on ArraySortedMap in C++ (firebase#721) by Gil <mcg>
  - 729b8d1 Move all Firestore Objective-C to Objective-C++ (firebase#734) by Gil <mcg>
  - 693d064 Merge pull request firebase#732 from OleksiyA/FCM-subscribe-compl... by Oleksiy Ivanov <oleksiy@informationrd.com>
  - 3cbdbf2 Schema migrations for LevelDB (firebase#728) by Greg Soltis <gsoltis>
  - 6474a82 Firestore DatabaseId in C++ (firebase#727) by zxu <zxu>
  - 05ef5ae Add absl_strings to firebase_firestore_util_test dependen... by rsgowman <rgowman>
  - 03a0069 Add changelog entry for my last PR (oops) and also add a ... by Michael Lehenbauer <mikelehen@gmail.com>
  - 5a280ca  Import iterator_adaptors from google3 (firebase#718) by Gil <mcg>
  - 63a380b Use fixed-sized types (firebase#719) by Gil <mcg>
  - 6dc1373 Version updates to 4.8.2 (firebase#722) by Paul Beusterien <paulbeusterien>
  - a74d39f Fix a number of c++ build errors (firebase#715) by rsgowman <rgowman>
  - cceeec3 travis: check for copyright in sources (firebase#717) by Paul Beusterien <paulbeusterien>
  - 4d7c973 Fix b/72502745: OnlineState changes cause limbo document ... by Michael Lehenbauer <mikelehen@gmail.com>
  - af6976a normalize and port the rest of Firebase/Port code (firebase#713) by zxu <zxu>
  - 7226b4a port TargetIdGenerator to iOS (firebase#709) by zxu <zxu>
  - 5306474 adding unit test for auto init enable function (firebase#710) by Chen Liang <chliang>
  - 821fb90 implement `TargetIdGenerator` in C++ for Firestore (firebase#701) by zxu <zxu>
  - 5fdda3f normalize string_util (firebase#708) by zxu <zxu>
  - 15a2926 Update CHANGELOG for M21.1 release (firebase#679) by Ryan Wilson <wilsonryan>
  - f027214 Fix incorrect deprecation message (firebase#688) by Iulian Onofrei <6d0847b9@opayq.com>
  - bfa0e40 Implement the rest of FieldValue types for C++ (firebase#687) by zxu <zxu>
  - 1f77212 Properly publish Abseil sources as a part of the podspec ... by Gil <mcg>

ORIGINAL_AUTHOR=Firebase <firebase-noreply>
PiperOrigin-RevId: 197713382
minafarid pushed a commit to minafarid/firebase-ios-sdk that referenced this pull request Jun 6, 2018
* implement FieldValue for null and boolean.
* Implement number and string FieldValue.
* Implement object FieldValue.
* implement timestamp FieldValue.
* Implement number and string FieldValue.
* implement public type `Blob` and `GeoPoint`
* implement Blob FieldValue
* Implement GeoPoint FieldValue
* refactoring `Blob`
@firebase firebase locked and limited conversation to collaborators Nov 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants