exwiw 0.9.15 → 0.9.16

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: 471697b8003fdbb3178382139b96d1954e4610691e1086d1336169cc5f26e572
4
- data.tar.gz: afd836794750c8ebd6b137f0067b386e8558a43b0c05f29df461e4e565257d11
3
+ metadata.gz: 39d7f662c156d9cd897af698c86f2af772c5918dcfd4126d833d08294da7b840
4
+ data.tar.gz: 79c08139a1e9bd7cb90858cba0a28cd0f442770165f6fd54488d9ae8ab49546a
5
5
  SHA512:
6
- metadata.gz: 9be9e481528119cacda6da2cd7be4379803c8be4fc03c49e9361d07f578f7e70ea6b5dab6c639c2acde2d63ec23933ba8e40e6ac60cddd2063db56ff7876aafe
7
- data.tar.gz: 5e40c552665e7a4b24e4729c8b4e6abb5d0dcefd52b61baf42e747a93b46e6268c09db53f70b4f45b60d63e451bb0a4588a3968b1bef02181e2544c7d8c3c1b0
6
+ metadata.gz: 7b3967012a3af6a90252a1c2d480d70aa9b7af6cd8824f73972b3d5efc0f1badf93cc43635c1b155201d1398279ffb40728c937df9f5f1544981e6ddcc6e1086
7
+ data.tar.gz: 0a0b8dafc3fb66166e09a208bfae07cc60251ddb8b6a6482ddb9eeb37355c176bfb019d02ebe546da211d33d8e64c77c63c03582c96b343d4408f82003472dc6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.16] - 2026-07-31
6
+
7
+ ### Fixed
8
+
9
+ - **MongoDB: a collection whose genuine (target-reachable) parents captured no ids now matches nothing instead of falling back to reference-parent constraints.** When the dump target legitimately owns no rows in a scoping chain (e.g. a just-created tenant with no rows in the anchor collection), the previous strict-AND fallback over reference parents — master data dumped in full — degenerated into a near-full-collection query: at best dumping cross-scope rows, at worst timing out or exceeding the BSON size limit on a large collection. Collections with no genuine parent at all (reachable only via reference data) keep the historical fallback.
10
+
5
11
  ## [0.9.15] - 2026-07-31
6
12
 
7
13
  ### Fixed
@@ -476,9 +476,13 @@ module Exwiw
476
476
  # has a genuine parent to anchor on, reference-parent constraints are
477
477
  # dropped entirely.
478
478
  #
479
- # When NO genuine parent produced ids, the collection is not reachable from
480
- # the dump target; fall back to the historical strict-AND of whatever
481
- # constraints exist (bounded, preserves prior behavior).
479
+ # - When the collection DECLARES a genuine parent but none captured any id
480
+ # (the dump target legitimately owns no such rows e.g. a tenant created
481
+ # moments ago), it matches nothing: reference-parent constraints do not
482
+ # narrow to the target, so falling back to them degenerates into a
483
+ # near-full-collection query. Only a collection with NO genuine parent at
484
+ # all (reachable only via reference data) keeps the historical strict-AND
485
+ # fallback.
482
486
  #
483
487
  # A belongs_to whose parent produced no ids contributes no constraint: either
484
488
  # the parent matched nothing, or it is not dumped here (e.g. an embedded
@@ -520,6 +524,16 @@ module Exwiw
520
524
  target << [relation.foreign_key, values]
521
525
  end
522
526
 
527
+ if genuine_clauses.empty? && reference_clauses.any? && config.belongs_tos.any? { |r| genuine.include?(r.table_name) }
528
+ @logger.warn(
529
+ " Collection '#{config.name}' is scoped by genuine parent(s) that captured no ids " \
530
+ "for this dump target; constraining it to match no rows instead of falling back to " \
531
+ "reference-parent constraints (which do not narrow to the target and can devolve " \
532
+ "into a full-collection scan)."
533
+ )
534
+ return { config.primary_key => { "$in" => [] } }
535
+ end
536
+
523
537
  filter =
524
538
  if genuine_clauses.any?
525
539
  anchor_index = (0...genuine_clauses.size).min_by { |i| genuine_clauses[i][1].size }
data/lib/exwiw/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exwiw
4
- VERSION = "0.9.15"
4
+ VERSION = "0.9.16"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exwiw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.15
4
+ version: 0.9.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shia