spree_cm_commissioner 2.12.4 → 2.12.5

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: f4502090937a0e1728668be217bf74bf24b37a424b3b412c1df11e061e72268c
4
- data.tar.gz: bca33ab83038577e339e01d24cc008c48d71e3af09a3131aa102f35d70433644
3
+ metadata.gz: c0228f6ca7b7b92d005af33e616b862a1ca576c9320b70510c7f235fbb058848
4
+ data.tar.gz: 66e3e4f595da2175c3fd0b06ca0c5712bb340b3fb8b9e1e1f71cd1495559dda9
5
5
  SHA512:
6
- metadata.gz: ca38d3fff9dd926ed84e6bf3ff0565d9af7b8fa6e816448b386fb460a757fdb7b31788dab65d287bedcaba869cd47b4351960bb8ddf0eef86c05caf3db118257
7
- data.tar.gz: ea4d544a09afe3fe32fce93f52587ffd1b25c0cf986c2ec94a291a2e07e2744d674acb6ef6c0c6a2886303360318d9b9f0d3cfabc2427a6fe775b7e025313e49
6
+ metadata.gz: 3a21bc63b5229c2ab198fa5d1d342b8375ed069d9a4cbee964243310a840a99acf9ab63b426defeca77b8f1f5511fcfa4fa8e5703c72fe580c06d53834452961
7
+ data.tar.gz: 71f6bd10a265ab1dd8c6ed0b30972105f3d2cfa332a2da3b6dfa347c8899eb1e97bb9962a6ff1c831b5cc3c6e3209409c435154e6cdc4f92a162191990bd2263
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.12.4)
37
+ spree_cm_commissioner (2.12.5)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -9,8 +9,8 @@ module SpreeCmCommissioner
9
9
  # Release at most this many guests per run, even when far more slots are free. A capacity spike
10
10
  # (cold start / lull → active_sessions low → available_slots ≈ max_sessions, e.g. 900) would
11
11
  # otherwise release every queued guest at once, dumping 900 simultaneous session-token requests
12
- # on the server. Capping paces entry at ~MAX_CALLS_PER_RUN/min (the caller runs every minute);
13
- # the rest stay queued and drain over the following runs.
12
+ # on the server. Capping paces entry at ~MAX_CALLS_PER_RUN per run (e.g. 30s, per
13
+ # config/schedule.yml); the rest stay queued and drain over the following runs.
14
14
  MAX_CALLS_PER_RUN = (ENV['WAITING_ROOM_MAX_CALLS_PER_RUN'] || 50).to_i
15
15
 
16
16
  def call
@@ -59,9 +59,21 @@ module SpreeCmCommissioner
59
59
  previous_guests + eligible_guests_in(records_path, remaining_slots)
60
60
  end
61
61
 
62
+ # This query requires a composite index (allow_to_enter_room_at ==, position !=, queued_at
63
+ # order); create it in Firebase beforehand, same as the plain index #fetch_long_waiting_guests
64
+ # already needed.
65
+ #
66
+ # The position != nil filter closes the call-before-stamp race: without it, a doc could be
67
+ # called here before StampQueuePositions ever assigns it a position, permanently excluding it
68
+ # from #eligible_guests_in (every future run still sees allow_to_enter_room_at == nil, but the
69
+ # calling_all write below sets it non-nil for good) while still counting toward
70
+ # total_exited_queue's unscoped count. Gating on position != nil makes "already stamped" true
71
+ # by construction before a doc can ever be called, instead of relying on StampQueuePositions
72
+ # reliably beating this job to it (e.g. 10s vs. 30s — see cm-market-server/config/schedule.yml).
62
73
  def eligible_guests_in(records_path, limit)
63
74
  firestore.col(records_path)
64
75
  .where('allow_to_enter_room_at', '==', nil)
76
+ .where('position', '!=', nil)
65
77
  .order('queued_at')
66
78
  .limit(limit)
67
79
  .get.to_a
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.12.4'.freeze
2
+ VERSION = '2.12.5'.freeze
3
3
 
4
4
  module_function
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cm_commissioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.4
4
+ version: 2.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - You
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-31 00:00:00.000000000 Z
11
+ date: 2026-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree