spree_cm_commissioner 2.13.1 → 2.13.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 709925b9130644b3e39ef1bb01415692019bc72643176593877c42f1a710ff0f
4
- data.tar.gz: a336bae1ac6555051a4d6c718d8cce7bb1fcbed67b8bea0a2accb5b96cb8ae1b
3
+ metadata.gz: 7c3bda3e011d6d81a2efce6c425673eafe576265fff3622d9d33134412b9ef8a
4
+ data.tar.gz: 38694b945396bbef5db96d065b9aabfe3da3b114a1769d16e1999969b4019215
5
5
  SHA512:
6
- metadata.gz: '0769de948ff5436227d88a348a051a7992956deca52f0a165c4cfa885750b9d672c9192482070d922b52921ded1b080a08c004eb6d33206ae67638ee4eec3a61'
7
- data.tar.gz: '09affaee452bf8a04579f43999a2beb71282b0d369109085fa59b63a8851d0c6fb80ad67b9ffc3930542ab6fe9e6b9c500c17b243380b5d33440225e30d8cc02'
6
+ metadata.gz: 5c34f6c30a980c3bf941d3b2ca569e603b27f8ee6020fa2369142ae8b52a909716f549820dd3aa189d5e1b7d095488c5e193dc41206b0ef2e6f7b9b8684e37e3
7
+ data.tar.gz: 36673f6411111297fb715c4280ac5d44a0c2c55576c377d4a68b5fb72d887060d585863a1abbbca1b2b53a0184a288317c00185fec722ec466c3bd7b23e95348
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.13.1)
37
+ spree_cm_commissioner (2.13.2)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -165,10 +165,22 @@ module SpreeCmCommissioner
165
165
  # the lobby pointer flips) into a single query, matching #fetch_long_waiting_guests's guard.
166
166
  # Order matters for read count only (not correctness): yesterday-first exits after one read on
167
167
  # the cross-midnight stragglers the caller drains first.
168
+ #
169
+ # left_at == nil matters as much here as it does in #eligible_guests_in: without it, any doc
170
+ # that was never admitted -- including every guest who already left the queue on their own or
171
+ # got swept, the overwhelmingly common case in a partition with real traffic -- reads as "still
172
+ # waiting" forever. That's what was making has_queue stick at true even with nobody left in
173
+ # line, needlessly forcing every fresh arrival into the queue (see shouldQueue on the client).
174
+ #
175
+ # No new composite index needed: (allow_to_enter_room_at ==, left_at ==) is a leading prefix of
176
+ # the (allow_to_enter_room_at ==, left_at ==, last_ping_at ==) index already tracked in
177
+ # firebase/firestore.indexes.json, and Firestore serves a query off a prefix of an existing
178
+ # composite index for free.
168
179
  def waiting_exists?(records_paths)
169
180
  records_paths.uniq.any? do |records_path|
170
181
  firestore.col(records_path)
171
182
  .where('allow_to_enter_room_at', '==', nil)
183
+ .where('left_at', '==', nil)
172
184
  .limit(1)
173
185
  .get.any?
174
186
  end
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.13.1'.freeze
2
+ VERSION = '2.13.2'.freeze
3
3
 
4
4
  module_function
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cm_commissioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.1
4
+ version: 2.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - You