statelydb 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/api/db/continue_list_pb.rb +1 -1
- data/lib/api/db/sync_list_pb.rb +1 -1
- data/lib/common/auth/auth0_token_provider.rb +5 -4
- data/lib/stately_codes.rb +7 -0
- data/lib/statelydb.rb +4 -2
- 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: 0ab280ee4fd3fa97d0664bdb6b5337fa2492fe952b3490f8cc6af1d93bd30174
|
4
|
+
data.tar.gz: db12681d9ad3e39dd642cddda23dde195f1e584da9119659ba995daec303909b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5437b8f31d4300a9409b4bea9e4db3c2f046a3f8f1b3b9e55646c10fd1e24e37e1147ee2afe6a6562e8f4d1f6abc130b9525896c1c1b9816108adc27b5c62342
|
7
|
+
data.tar.gz: dff2b5feb310a189392d270835e63110ab273ca54e71d12ae2fcd58222d412e364f80c8f7e849e4249241c4242ff8ada2595fa5ad1790580214a4efccbfba3f4
|
@@ -5,7 +5,7 @@
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
7
|
|
8
|
-
descriptor_data = "\n\x16\x64\x62/continue_list.proto\x12\nstately.db\"
|
8
|
+
descriptor_data = "\n\x16\x64\x62/continue_list.proto\x12\nstately.db\"\xa1\x01\n\x13\x43ontinueListRequest\x12\x1d\n\ntoken_data\x18\x01 \x01(\x0cR\ttokenData\x12?\n\tdirection\x18\x02 \x01(\x0e\x32!.stately.db.ContinueListDirectionR\tdirection\x12*\n\x11schema_version_id\x18\x05 \x01(\rR\x0fschemaVersionId*N\n\x15\x43ontinueListDirection\x12\x19\n\x15\x43ONTINUE_LIST_FORWARD\x10\x00\x12\x1a\n\x16\x43ONTINUE_LIST_BACKWARD\x10\x01\x42l\n\x0e\x63om.stately.dbB\x11\x43ontinueListProtoP\x01\xa2\x02\x03SDX\xaa\x02\nStately.Db\xca\x02\nStately\\Db\xe2\x02\x16Stately\\Db\\GPBMetadata\xea\x02\x0bStately::Dbb\x06proto3"
|
9
9
|
|
10
10
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
11
|
pool.add_serialized_file(descriptor_data)
|
data/lib/api/db/sync_list_pb.rb
CHANGED
@@ -8,7 +8,7 @@ require 'db/item_pb'
|
|
8
8
|
require 'db/list_pb'
|
9
9
|
|
10
10
|
|
11
|
-
descriptor_data = "\n\x12\x64\x62/sync_list.proto\x12\nstately.db\x1a\rdb/item.proto\x1a\rdb/list.proto\"
|
11
|
+
descriptor_data = "\n\x12\x64\x62/sync_list.proto\x12\nstately.db\x1a\rdb/item.proto\x1a\rdb/list.proto\"\\\n\x0fSyncListRequest\x12\x1d\n\ntoken_data\x18\x01 \x01(\x0cR\ttokenData\x12*\n\x11schema_version_id\x18\x05 \x01(\rR\x0fschemaVersionId\"\xc8\x01\n\x10SyncListResponse\x12\x31\n\x05reset\x18\x01 \x01(\x0b\x32\x19.stately.db.SyncListResetH\x00R\x05reset\x12=\n\x06result\x18\x02 \x01(\x0b\x32#.stately.db.SyncListPartialResponseH\x00R\x06result\x12\x36\n\x08\x66inished\x18\x03 \x01(\x0b\x32\x18.stately.db.ListFinishedH\x00R\x08\x66inishedB\n\n\x08response\"\x0f\n\rSyncListReset\"\xdf\x01\n\x17SyncListPartialResponse\x12\x35\n\rchanged_items\x18\x01 \x03(\x0b\x32\x10.stately.db.ItemR\x0c\x63hangedItems\x12<\n\rdeleted_items\x18\x02 \x03(\x0b\x32\x17.stately.db.DeletedItemR\x0c\x64\x65letedItems\x12O\n%updated_item_keys_outside_list_window\x18\x03 \x03(\tR updatedItemKeysOutsideListWindow\"(\n\x0b\x44\x65letedItem\x12\x19\n\x08key_path\x18\x01 \x01(\tR\x07keyPathBh\n\x0e\x63om.stately.dbB\rSyncListProtoP\x01\xa2\x02\x03SDX\xaa\x02\nStately.Db\xca\x02\nStately\\Db\xe2\x02\x16Stately\\Db\\GPBMetadata\xea\x02\x0bStately::Dbb\x06proto3"
|
12
12
|
|
13
13
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
14
|
pool.add_serialized_file(descriptor_data)
|
@@ -100,10 +100,11 @@ module StatelyDB
|
|
100
100
|
# there is no non-blocking sleep in ruby.
|
101
101
|
# skip this if we have a pending timer thread already
|
102
102
|
@timer = Thread.new do
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
|
103
|
+
# Calculate a random multiplier between 0.3 and 0.8 to to apply to the expiry
|
104
|
+
# so that we refresh in the background ahead of expiration, but avoid
|
105
|
+
# multiple processes hammering the service at the same time.
|
106
|
+
jitter = (Random.rand * 0.5) + 0.3
|
107
|
+
delay = resp_data["expires_in"] * jitter
|
107
108
|
sleep(delay)
|
108
109
|
refresh_token
|
109
110
|
end
|
data/lib/stately_codes.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module StatelyCode
|
4
|
+
# CachedSchemaTooOld indicates that schema was recently updated and internal
|
5
|
+
# caches have not yet caught up. If this problem persists, please contact support.
|
6
|
+
#
|
7
|
+
# - Retryable
|
8
|
+
# This error is immediately retryable.
|
9
|
+
CACHED_SCHEMA_TOO_OLD = "CachedSchemaTooOld"
|
10
|
+
|
4
11
|
# ConcurrentModification indicates the current transaction was aborted
|
5
12
|
# because of a non-serializable interaction with another transaction was
|
6
13
|
# detected, a stale read was detected, or because attempts to resolve an
|
data/lib/statelydb.rb
CHANGED
@@ -142,7 +142,8 @@ module StatelyDB
|
|
142
142
|
# client.data.continue_list(token)
|
143
143
|
def continue_list(token)
|
144
144
|
req = Stately::Db::ContinueListRequest.new(
|
145
|
-
token_data: token.token_data
|
145
|
+
token_data: token.token_data,
|
146
|
+
schema_version_id: @schema::SCHEMA_VERSION_ID
|
146
147
|
)
|
147
148
|
resp = @stub.continue_list(req)
|
148
149
|
process_list_response(resp)
|
@@ -158,7 +159,8 @@ module StatelyDB
|
|
158
159
|
# client.data.sync_list(token)
|
159
160
|
def sync_list(token)
|
160
161
|
req = Stately::Db::SyncListRequest.new(
|
161
|
-
token_data: token.token_data
|
162
|
+
token_data: token.token_data,
|
163
|
+
schema_version_id: @schema::SCHEMA_VERSION_ID
|
162
164
|
)
|
163
165
|
resp = @stub.sync_list(req)
|
164
166
|
process_sync_response(resp)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statelydb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stately Cloud, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|