pub_sub_model_sync 1.6.1 → 1.6.3

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: c7b82f843724eb07ce764e12b1b8293fbff447563865d85a88d1ddfbf4f0dcf3
4
- data.tar.gz: 334f471d02f069a3f718bee913152c0cabc9ae0b8f63601fcf5a795b3f94c5e0
3
+ metadata.gz: d7ea520bc38ca14cb53e4163ed40fb3d2393fc7eff35effedf379e56f25e8372
4
+ data.tar.gz: ddbec139ee891136fc5cba84cb90a7a3828ab4de17b971ac6a33039d8070d165
5
5
  SHA512:
6
- metadata.gz: 106fda17c11202615bbe465fc459b3ffb5201936ff6e6ea6a229e67530da7b06bd91c6230a425efb0f014b7b2c1e1d2a3495447b6e8f7069450a46d7ca882d76
7
- data.tar.gz: 2d7a56d05a761bb768e61634ff3f707152e474a589a80a4687166fbbc35178424ce211df5cdfa2b03bddde2e4abc7708361fba549ed3f1772956a0367fa5e038
6
+ metadata.gz: f3b5c26a832cd758abc4fa66e23698cf7fcc44b4c81f4701b372eb20ce99553a8abfdbb4d94c15d4aa788af347078f1068998ec41c866235d4413aac871057cc
7
+ data.tar.gz: 98b36dd457b82fd78b383ab98eb73f10115fc1650cf0b00d1041f9e87afef797c72e0eb17fdca2333fe923ad9df0aed5e63916043ac31d8cb3a64e4dbc463038
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pub_sub_model_sync (1.6.1pre)
4
+ pub_sub_model_sync (1.6.3)
5
5
  rails
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -380,7 +380,7 @@ Note: To reduce Payload size, some header info are not delivered (Enable debug m
380
380
  **Note**: When any error is raised when saving user or posts, the transaction is cancelled and thus all notifications wont be delivered (customizable by `PubSubModelSync::Config.transactions_use_buffer`).
381
381
 
382
382
  - Manual transactions
383
- `PubSubModelSync::MessagePublisher::transaction(key, max_buffer: , &block)`
383
+ `PubSubModelSync::MessagePublisher::transaction(key, headers: { target_app_key: 'my_other_app_key' } &block)`
384
384
  - `key` (String|nil) Key used as the ordering_key for all inner notifications (When nil, will use `ordering_key` of the first notification)
385
385
  - `max_buffer:` (Integer, default: `PubSubModelSync::Config.transactions_max_buffer`) Transaction buffer size (DEPRECATED).
386
386
  - `headers:` (Hash) Header settings to be added to each Payload's header inside this transaction
@@ -20,12 +20,13 @@ module PubSubModelSync
20
20
  payload_info = { klass: payload.klass, action: payload.action, mode: payload.mode }
21
21
  log("No subscribers found for #{payload_info}", :warn) if config.debug && subscribers.empty?
22
22
  subscribers.each(&method(:run_subscriber))
23
+ rescue => e
24
+ notify_error(e)
25
+ raise
23
26
  end
24
27
 
25
28
  def process
26
- process!
27
- rescue => e
28
- notify_error(e)
29
+ process! rescue nil # rubocop:disable Style/RescueModifier
29
30
  end
30
31
 
31
32
  private
@@ -56,7 +57,6 @@ module PubSubModelSync
56
57
  res = config.on_error_processing.call(error, { payload: payload })
57
58
  log("#{error_msg} #{error_details}", :error) if res != :skip_log
58
59
  rescue => e
59
- error_details = [payload, e.message, e.backtrace]
60
60
  log("#{error_msg} #{error_details}", :error)
61
61
  raise(e)
62
62
  end
@@ -85,7 +85,10 @@ module PubSubModelSync
85
85
 
86
86
  # @param attr_keys (Array<Symbol>) List of attributes to be excluded from payload
87
87
  def exclude_data_attrs(attr_keys)
88
+ orig_data = data.clone
89
+ headers[:excluded_attr_keys] = attr_keys.join(',')
88
90
  @data = data.except(*attr_keys)
91
+ Config.log("Empty payload after payload optimization (original data: #{[self, orig_data]})") if @data == []
89
92
  end
90
93
 
91
94
  # Attributes to always be delivered after cache optimization
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PubSubModelSync
4
- VERSION = '1.6.1'
4
+ VERSION = '1.6.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pub_sub_model_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-26 00:00:00.000000000 Z
11
+ date: 2022-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails