mbuzz 0.8.0 → 0.8.1

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: 9c505c0b0158b298f75611d2a8fe9ecb2682c869da57eacc3bd1b4d74d13a7f2
4
- data.tar.gz: 3cc79da1b2ec0afbabf7e1ab9d965688da2445f57d4d930ad9a6979649a4b667
3
+ metadata.gz: a3725da0e1a4fb06b393abd356cf408a7bc2a1ba27aeed2e4bc49b9047469b77
4
+ data.tar.gz: 926572f620afc1108fb902b3270404b79b35e112285efd032fd449c4c7f84164
5
5
  SHA512:
6
- metadata.gz: 25d6e828fb41cd61e5a83ddd372368b31fee3629f4c1a42decf313f63ae68bf18a505101efd4e0da10dbcb2cc584e6b4591448e73853e2d6bbd42aab5478bb70
7
- data.tar.gz: 6dd0b561d3d17ed20ad41e67993f45a24902fe1a7076da9c7077e02a88a5e45be613a898fb7e1728032e38d6e79ccd2af231bbda4c185db7789bdd832f18e7d5
6
+ metadata.gz: '0718ffe4e0ee5ca2aa499aefdf7ef7c79046f99ab35ab19f8cd9209ba8b6c75f42be031e82f1cef4a875249cd2e846a74c5401a798b3036bad96386ade2ce5b6'
7
+ data.tar.gz: 9d9952f1adfdfd15320946b6416ae84a5c1f10c1b2a7a81eb972dc184e36f18684674cc7129afaa1a97b877c546febf412112ddec6e74b64278111cdabc30456
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.8.1] - 2026-03-16
9
+
10
+ ### Fixed
11
+
12
+ - **`event()` and `conversion()` now handle proxy-buffered responses gracefully** — when the edge proxy accepts a request but Rails is temporarily unreachable, the SDK returns `{ success: true }` with nil IDs instead of `false`. Data is safe in the proxy buffer and will be processed on recovery.
13
+
8
14
  ## [0.8.0] - 2026-03-13
9
15
 
10
16
  ### Changed
@@ -19,15 +19,25 @@ module Mbuzz
19
19
  end
20
20
 
21
21
  def call
22
- return false unless valid?
22
+ return false unless input_valid?
23
+ return proxy_result if proxy_accepted?
24
+ return false unless conversion_id
23
25
 
24
26
  { success: true, conversion_id: conversion_id, attribution: attribution }
25
27
  end
26
28
 
27
29
  private
28
30
 
29
- def valid?
30
- has_identifier? && present?(@conversion_type) && hash?(@properties) && conversion_id
31
+ def input_valid?
32
+ has_identifier? && present?(@conversion_type) && hash?(@properties)
33
+ end
34
+
35
+ def proxy_accepted?
36
+ response && response["status"] == "accepted" && !response.key?("conversion")
37
+ end
38
+
39
+ def proxy_result
40
+ { success: true, conversion_id: nil, attribution: nil }
31
41
  end
32
42
 
33
43
  def has_identifier?
@@ -14,7 +14,9 @@ module Mbuzz
14
14
  end
15
15
 
16
16
  def call
17
- return false unless valid?
17
+ return false unless input_valid?
18
+ return proxy_result if proxy_accepted?
19
+ return false unless event
18
20
 
19
21
  { success: true, event_id: event["id"], event_type: event["event_type"],
20
22
  visitor_id: event["visitor_id"], session_id: event["session_id"] }
@@ -22,8 +24,16 @@ module Mbuzz
22
24
 
23
25
  private
24
26
 
25
- def valid?
26
- present?(@event_type) && hash?(@properties) && (@user_id || @visitor_id) && event
27
+ def input_valid?
28
+ present?(@event_type) && hash?(@properties) && (@user_id || @visitor_id)
29
+ end
30
+
31
+ def proxy_accepted?
32
+ response && response["status"] == "accepted" && !response.key?("events")
33
+ end
34
+
35
+ def proxy_result
36
+ { success: true, event_id: nil, event_type: @event_type, visitor_id: @visitor_id, session_id: nil }
27
37
  end
28
38
 
29
39
  def event
data/lib/mbuzz/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mbuzz
4
- VERSION = "0.8.0"
4
+ VERSION = "0.8.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbuzz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbuzz team