Skip to content
8 changes: 8 additions & 0 deletions firestore/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,14 @@ TEST_F(FirebaseFirestoreBasicTest, TestQuery) {
"int", firebase::firestore::FieldValue::Integer(101))))));
}

TEST_F(FirebaseFirestoreBasicTest, TestDocumentChangeNpos) {
// This test may seem pointless, but it exists to avoid the long-standing
// latent bug that `npos` was not defined on non-Android platforms and
// would therefore fail to link if used.
EXPECT_EQ(firebase::firestore::DocumentChange::npos,
static_cast<std::size_t>(-1));
}

TEST_F(FirebaseFirestoreBasicTest,
TestInvalidatingReferencesWhenDeletingFirestore) {
delete firestore_;
Expand Down
8 changes: 8 additions & 0 deletions firestore/integration_test_internal/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,14 @@ TEST_F(FirebaseFirestoreBasicTest, TestQuery) {
"int", firebase::firestore::FieldValue::Integer(101))))));
}

TEST_F(FirebaseFirestoreBasicTest, TestDocumentChangeNpos) {
// This test may seem pointless, but it exists to avoid the long-standing
// latent bug that `npos` was not defined on non-Android platforms and
// would therefore fail to link if used.
EXPECT_EQ(firebase::firestore::DocumentChange::npos,
static_cast<std::size_t>(-1));
}

TEST_F(FirebaseFirestoreBasicTest,
TestInvalidatingReferencesWhenDeletingFirestore) {
delete firestore_;
Expand Down
2 changes: 2 additions & 0 deletions firestore/src/common/document_change.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ using Type = DocumentChange::Type;
// Older NDK (r16b) fails to define this properly. Fix this when support for
// the older NDK is removed.
const std::size_t DocumentChange::npos = static_cast<std::size_t>(-1);
#else
constexpr std::size_t DocumentChange::npos;
#endif // defined(ANDROID)

DocumentChange::DocumentChange() {}
Expand Down
5 changes: 5 additions & 0 deletions release_build_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,11 @@ code.

## Release Notes

### 8.1.0
- Changes
- Firestore: Fixed a linker error when `DocumentChange::npos` was used.
([#474](https://github.com/firebase/firebase-cpp-sdk/pull/474)).
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional: I think the changelog usually links to issues, not PRs, so this link could probably be omited.

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 looks like there is a mixture of issues and PRs linked to in previous change log entries. I see your point but I personally feel like adding a link to additional context is useful for future readers. If this issue had been discovered externally then there would be an issue number; however, since it was discovered by me, a developer on the Firestore team, no issue was created. IMO, providing this link adds value at no cost. If you feel strongly I can remove it, but I like having it here.


### 8.0.0
- Changes
- Analytics: Removed `SetCurrentScreen()` following its removal from iOS SDK
Expand Down