Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public TransactionOptionsType getType() {
/**
* A {@link Timestamp} specifying the time documents are to be read at. If null, the server will
* read documents at the most up to date available. If non-null, the specified {@code Timestamp}
* may not be more than 60 seconds in the past (evaluated when the request is processed by the
* may not be more than 60 minutes in the past (evaluated when the request is processed by the
* server).
*
* @return The specific time to read documents at. A null value means reading the most up to date
Expand Down Expand Up @@ -239,10 +239,10 @@ public TimestampOrBuilder getReadTime() {
}

/**
* Specify to read documents at the given time. This may not be more than 60 seconds in the past
* Specify to read documents at the given time. This may not be more than 60 minutes in the past
* from when the request is processed by the server.
*
* @param readTime The specific time to read documents at. Must not be older than 60 seconds. A
* @param readTime The specific time to read documents at. Must not be older than 60 minutes. A
* null value means read most up to date data.
* @return {@code this} builder
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ public ApiFuture<T> apply(Void input) {
final SettableApiFuture<Void> backoff = SettableApiFuture.create();
// Add a backoff delay. At first, this is 0.
firestoreExecutor.schedule(
() -> {
backoff.set(null);
},
() -> backoff.set(null),
nextBackoffAttempt.getRandomizedRetryDelay().toMillis(),
TimeUnit.MILLISECONDS);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1559,12 +1559,15 @@ public void readOnlyTransaction_failureWhenAttemptReadOlderThan60Seconds()
throws ExecutionException, InterruptedException, TimeoutException {
final DocumentReference documentReference = randomColl.add(SINGLE_FIELD_MAP).get();

// Exception isn't thrown until 5 minutes.
final long tenMinutes = System.currentTimeMillis() / 1000 - 600;
// Exception isn't thrown until 60 minutes.
// To ensure we exceed this, we use 120 minutes.
// If this test fails, we should likely be update documentation to reflect new value. See all
// usages of "Read Time" on proto, and within SDK.
final long twoHours = System.currentTimeMillis() / 1000 - 7200;
final TransactionOptions options =
TransactionOptions.createReadOnlyOptionsBuilder()
.setReadTime(
com.google.protobuf.Timestamp.newBuilder().setSeconds(tenMinutes).setNanos(0))
com.google.protobuf.Timestamp.newBuilder().setSeconds(twoHours).setNanos(0))
.build();

final ApiFuture<Void> runTransaction =
Expand Down