table_sync 4.2.1 → 4.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/table_sync/receiving/handler.rb +11 -0
- data/lib/table_sync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d5af530003a4144653d1866fda0a581a5ecf021cbcd8e7c2a29028c0e838eb2
|
4
|
+
data.tar.gz: 836de51df89dc99294bd8be65eeaf4e00cba6bdb22071170bef42372c4984a70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2558335ef49a853d8d0d12878cdb42cfb91d4bf7dc7838f22c4853dbf09a22aa60569c420eaee0f5a667f21ea55c02b4a62d3c9d7a4299128d2a6d4b47d7b76a
|
7
|
+
data.tar.gz: d24f3e8e2cab9f946a37296261d531a44b3ea6e660aa1a9424e0685c9ba2ffff73130e6b9661f3ff76a0636eab9c877e4f7b18ce2c1b7b65326bfb5d2434df48
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [4.2.2] - 2020-11-20
|
5
|
+
### Fixed
|
6
|
+
- potential data corruption with batches
|
7
|
+
|
4
8
|
## [4.2.1] - 2020-11-20
|
5
9
|
### Fixed
|
6
10
|
- bug with sorting data in handler, it was bad idea to use `.hash` replaced to `.to_s`
|
data/Gemfile.lock
CHANGED
@@ -107,6 +107,17 @@ class TableSync::Receiving::Handler < Rabbit::EventHandler
|
|
107
107
|
if data.uniq { |row| row.slice(*target_keys) }.size != data.size
|
108
108
|
raise TableSync::DataError.new(data, target_keys, "Duplicate rows found!")
|
109
109
|
end
|
110
|
+
|
111
|
+
keys_sample = data[0].keys
|
112
|
+
keys_diff = data.each_with_object(Set.new) do |row, set|
|
113
|
+
(row.keys - keys_sample | keys_sample - row.keys).each(&set.method(:add))
|
114
|
+
end
|
115
|
+
|
116
|
+
unless keys_diff.empty?
|
117
|
+
raise TableSync::DataError.new(data, target_keys, <<~MESSAGE)
|
118
|
+
Bad batch structure, check keys: #{keys_diff.to_a}
|
119
|
+
MESSAGE
|
120
|
+
end
|
110
121
|
end
|
111
122
|
|
112
123
|
def perform(config, params)
|
data/lib/table_sync/version.rb
CHANGED