audiences 3.2.1 → 3.2.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: ca6dae8a08e2e2703e139555772d0a1143cb8511b0cd4c5820d6f3f2c3c91581
4
- data.tar.gz: 6327e89cd3a1970bb8cffb02ebaef89b5e71d48dfb8d6321758aa3159484cec1
3
+ metadata.gz: d5e06a1b5a2d461aaaadb42a0b4c476d244a534a631e1bcfd0fbeea035597376
4
+ data.tar.gz: 721a4d4909c843134a8a38f062a3261845b7ea6ecf11254cd1bbb2054db97293
5
5
  SHA512:
6
- metadata.gz: 390dff4c5768d1a7e7d6745e5f4af302cdd6c6c9f55bb675edd246408bd59daa4221ded9878360fc03ecf078f20a5fba9ae23d5401c5f3fc956863e4950e2679
7
- data.tar.gz: b669cd8ff6d4ccc7a1b3c70b4c761b888b84c13ee6f4ff7c89498cf864e8d010a662992049f56173b4eca844777402728167c78c67ef58cf23b9fae28dc7459c
6
+ metadata.gz: 27976c3456b6c6e562d88baefd1ee465987c9152922545d3b89252b0f4828e53a1b07bc6900c336c69bc78ed3f11076eb5091cf52a9f491ff4238882bb121a8a
7
+ data.tar.gz: edef95656c3580a61ce9612d648a36651d55b868995dbfb6d9998181d401c84d7478afc038d86da2aad09fdc9bf592cedfcc9b414cf934e965eb6483a143e3b6
@@ -45,13 +45,16 @@ module Audiences
45
45
  end
46
46
 
47
47
  scope :matching, ->(criterion) do
48
- return none if criterion.groups.empty?
49
-
50
- criterion.groups
51
- .group_by(&:resource_type)
52
- .values
53
- .reduce(self) do |scope, groups|
54
- scope.members_of(groups)
48
+ # Load the groups once: checking emptiness and loading separately lets a
49
+ # concurrent criteria update empty the groups in between, and reducing
50
+ # over no groups would match every user.
51
+ groups = criterion.groups.to_a
52
+ return none if groups.empty?
53
+
54
+ groups.group_by(&:resource_type)
55
+ .values
56
+ .reduce(self) do |scope, type_groups|
57
+ scope.members_of(type_groups)
55
58
  end
56
59
  end
57
60
 
data/docs/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # Version 3.2.2 (2026-11-04)
2
+
3
+ **Bug Fixes:**
4
+ - Fix a race where a criterion could match every user when a concurrent context update replaced the criteria while the audience was being resolved. `ExternalUser.matching` now loads a criterion's groups once, so a criterion with no groups always matches no one.
5
+
1
6
  # Version 3.2.1 (2026-10-22)
2
7
 
3
8
  **Compatibility:**
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Audiences
4
- VERSION = "3.2.1"
4
+ VERSION = "3.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audiences
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Palhares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-22 00:00:00.000000000 Z
11
+ date: 2026-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aether_observatory
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.5.16
129
+ rubygems_version: 3.5.22
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Audiences system