google-cloud-firestore 2.6.1 → 2.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/google/cloud/firestore/client.rb +18 -7
- data/lib/google/cloud/firestore/field_path.rb +3 -7
- data/lib/google/cloud/firestore/service.rb +1 -1
- data/lib/google/cloud/firestore/version.rb +1 -1
- data/lib/google/cloud/firestore.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ce1f6d742ab22f8ae9048c2b32ee29066133c449a7ddcc6f1cc821a62f02151
|
4
|
+
data.tar.gz: 6818b31d6e877da83416f01494cd8034ba54ee99161ce443d7f6862ed65f1202
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a68a90e078451cade335996d3f7cb2545d1b275726ecfe8f417eeae480d42bf53cd181ad5ac53f42adbb516b9ccf9264172b038ef7c87843c8130617a35b2b90
|
7
|
+
data.tar.gz: 3535f4d765f78fd1da1cbc2808a974e9a0782d43e6cd3ed31c9f1ba33c4f31ea44142e3f66d28f27bd455eeae4cdea874c4e3953dc62da5871dd4c85b9aca5a4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 2.6.5 / 2021-10-25
|
4
|
+
|
5
|
+
#### Documentation
|
6
|
+
|
7
|
+
* Add documentation for quota_project Configuration attribute
|
8
|
+
|
9
|
+
### 2.6.4 / 2021-08-26
|
10
|
+
|
11
|
+
#### Bug Fixes
|
12
|
+
|
13
|
+
* Fix google-cloud-resource-prefix header
|
14
|
+
|
15
|
+
### 2.6.3 / 2021-08-24
|
16
|
+
|
17
|
+
#### Bug Fixes
|
18
|
+
|
19
|
+
* Fix transaction retry behavior
|
20
|
+
|
21
|
+
### 2.6.2 / 2021-07-26
|
22
|
+
|
23
|
+
#### Bug Fixes
|
24
|
+
|
25
|
+
* Update FieldPath#formatted_string to correctly escape non-simple characters
|
26
|
+
|
3
27
|
### 2.6.1 / 2021-07-08
|
4
28
|
|
5
29
|
#### Documentation
|
@@ -628,7 +628,24 @@ module Google
|
|
628
628
|
commit_return = transaction.commit
|
629
629
|
# Conditional return value, depending on truthy commit_response
|
630
630
|
commit_response ? commit_return : transaction_return
|
631
|
-
rescue Google::Cloud::
|
631
|
+
rescue Google::Cloud::AbortedError,
|
632
|
+
Google::Cloud::CanceledError,
|
633
|
+
Google::Cloud::UnknownError,
|
634
|
+
Google::Cloud::DeadlineExceededError,
|
635
|
+
Google::Cloud::InternalError,
|
636
|
+
Google::Cloud::UnauthenticatedError,
|
637
|
+
Google::Cloud::ResourceExhaustedError,
|
638
|
+
Google::Cloud::UnavailableError,
|
639
|
+
Google::Cloud::InvalidArgumentError => e
|
640
|
+
|
641
|
+
if e.instance_of? Google::Cloud::InvalidArgumentError
|
642
|
+
# Return if a previous call was retried but ultimately succeeded
|
643
|
+
return nil if backoff[:current].positive?
|
644
|
+
# The Firestore backend uses "INVALID_ARGUMENT" for transaction IDs that have expired.
|
645
|
+
# While INVALID_ARGUMENT is generally not retryable, we retry this specific case.
|
646
|
+
raise e unless e.message =~ /transaction has expired/
|
647
|
+
end
|
648
|
+
|
632
649
|
# Re-raise if retried more than the max
|
633
650
|
raise e if backoff[:current] > backoff[:max]
|
634
651
|
|
@@ -643,12 +660,6 @@ module Google
|
|
643
660
|
transaction = Transaction.from_client \
|
644
661
|
self, previous_transaction: transaction.transaction_id
|
645
662
|
retry
|
646
|
-
rescue Google::Cloud::InvalidArgumentError => e
|
647
|
-
# Return if a previous call was retried but ultimately succeeded
|
648
|
-
return nil if backoff[:current].positive?
|
649
|
-
|
650
|
-
# Re-raise error.
|
651
|
-
raise e
|
652
663
|
rescue StandardError => e
|
653
664
|
# Rollback transaction when handling unexpected error
|
654
665
|
transaction.rollback rescue nil
|
@@ -209,19 +209,15 @@ module Google
|
|
209
209
|
|
210
210
|
protected
|
211
211
|
|
212
|
-
START_FIELD_PATH_CHARS = /\A[a-zA-Z_]/.freeze
|
213
212
|
INVALID_FIELD_PATH_CHARS = %r{[~*/\[\]]}.freeze
|
213
|
+
SIMPLE_FIELD_PATH_CHARS = /\A[_a-zA-Z][_a-zA-Z0-9]*\Z/.freeze
|
214
214
|
|
215
215
|
def escape_field_for_path field
|
216
216
|
field = String field
|
217
217
|
|
218
|
-
if
|
219
|
-
field["."] || field["`"] || field["\\"]
|
220
|
-
escaped_field = field.gsub(/[`\\]/, "`" => "\\\`", "\\" => "\\\\")
|
221
|
-
return "`#{escaped_field}`"
|
222
|
-
end
|
218
|
+
return field if SIMPLE_FIELD_PATH_CHARS.match field
|
223
219
|
|
224
|
-
|
220
|
+
field = field.gsub(/[`\\]/, "`" => "\\`", "\\" => "\\\\")
|
225
221
|
|
226
222
|
"`#{field}`"
|
227
223
|
end
|
@@ -48,7 +48,7 @@ module Google
|
|
48
48
|
config.endpoint = host if host
|
49
49
|
config.lib_name = "gccl"
|
50
50
|
config.lib_version = Google::Cloud::Firestore::VERSION
|
51
|
-
config.metadata = { "google-cloud-resource-prefix": "projects/#{@project}" }
|
51
|
+
config.metadata = { "google-cloud-resource-prefix": "projects/#{@project}/databases/(default)" }
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -122,6 +122,8 @@ module Google
|
|
122
122
|
# parameter `keyfile` is considered deprecated, but may also be used.)
|
123
123
|
# * `scope` - (String, Array<String>) The OAuth 2.0 scopes controlling
|
124
124
|
# the set of resources and operations that the connection can access.
|
125
|
+
# * `quota_project` - (String) The project ID for a project that can be
|
126
|
+
# used by client libraries for quota and billing purposes.
|
125
127
|
# * `timeout` - (Integer) Default timeout to use in requests.
|
126
128
|
# * `endpoint` - (String) Override of the endpoint host name, or `nil`
|
127
129
|
# to use the default endpoint.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-firestore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|