Skip to content

Commit

Permalink
Merge branch 'master' into migrate-set-output-to-GITHUB_OUTPUT
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazo authored Jul 24, 2023
2 parents a969e9c + d86eb6f commit 68eb014
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1077,17 +1077,18 @@ public void resumingAQueryShouldUseBloomFilterToAvoidFullRequery() throws Except
}
assertWithMessage("createdDocuments").that(createdDocuments).hasSize(100);

// Delete 50 of the 100 documents. Use a WriteBatch, rather than DocumentReference.delete(),
// to avoid affecting the local cache.
// Delete 50 of the 100 documents. Use a different Firestore instance to avoid affecting the
// local cache.
HashSet<String> deletedDocumentIds = new HashSet<>();
{
WriteBatch writeBatchForDocumentDeletes = collection.getFirestore().batch();
FirebaseFirestore db2 = testFirestore();
WriteBatch batch = db2.batch();
for (int i = 0; i < createdDocuments.size(); i += 2) {
DocumentReference documentToDelete = createdDocuments.get(i);
writeBatchForDocumentDeletes.delete(documentToDelete);
DocumentReference documentToDelete = db2.document(createdDocuments.get(i).getPath());
batch.delete(documentToDelete);
deletedDocumentIds.add(documentToDelete.getId());
}
waitFor(writeBatchForDocumentDeletes.commit());
waitFor(batch.commit());
}
assertWithMessage("deletedDocumentIds").that(deletedDocumentIds).hasSize(50);

Expand Down Expand Up @@ -1236,14 +1237,10 @@ public void bloomFilterShouldCorrectlyEncodeComplexUnicodeCharacters() throws Ex
}

// Delete one of the documents so that the next call to collection.get() will experience an
// existence filter mismatch. Use a WriteBatch, rather than DocumentReference.delete(), to avoid
// affecting the local cache.
// existence filter mismatch. Use a different Firestore instance to avoid affecting the local
// cache.
DocumentReference documentToDelete = collection.document("DocumentToDelete");
{
WriteBatch writeBatchForDocumentDeletes = collection.getFirestore().batch();
writeBatchForDocumentDeletes.delete(documentToDelete);
waitFor(writeBatchForDocumentDeletes.commit());
}
waitFor(testFirestore().document(documentToDelete.getPath()).delete());

// Wait for 10 seconds, during which Watch will stop tracking the query and will send an
// existence filter rather than "delete" events when the query is resumed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ internal class RemoteSettingsFetcher(
onFailure: suspend (String) -> Unit
) =
withContext(blockingDispatcher) {
val connection = settingsUrl().openConnection() as HttpsURLConnection
connection.requestMethod = "GET"
connection.setRequestProperty("Accept", "application/json")
headerOptions.forEach { connection.setRequestProperty(it.key, it.value) }

try {
val connection = settingsUrl().openConnection() as HttpsURLConnection
connection.requestMethod = "GET"
connection.setRequestProperty("Accept", "application/json")
headerOptions.forEach { connection.setRequestProperty(it.key, it.value) }

val responseCode = connection.responseCode
if (responseCode == HttpsURLConnection.HTTP_OK) {
val inputStream = connection.inputStream
Expand Down

0 comments on commit 68eb014

Please sign in to comment.