mbuzz 0.7.5 → 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: 98a247dfdbac350b725b7a1c1a6fb4be2c7afde877c84e37a0b5c2f29a277405
4
- data.tar.gz: 5b8851d41743b66c41dda9fa428a9a14d9dbe9ffd9c74dbf067ab09f96cb855e
3
+ metadata.gz: a3725da0e1a4fb06b393abd356cf408a7bc2a1ba27aeed2e4bc49b9047469b77
4
+ data.tar.gz: 926572f620afc1108fb902b3270404b79b35e112285efd032fd449c4c7f84164
5
5
  SHA512:
6
- metadata.gz: 7110c24d4ac63ccd9509a59cc1652fab5cb20a5ed16dbd004f029bbbffd809265ef6f47727e3b0057f94c87fb1c0582c94c756d148002756121b64d94731e7dc
7
- data.tar.gz: fdc0825294afaba77dd79d9bd25f7d7c9d4d85f080da289917d5442117aaf8030a6043ccab5031c86ea91f6ff22f858f77f5605a018b2493feacb0b23d0cfb4a
6
+ metadata.gz: '0718ffe4e0ee5ca2aa499aefdf7ef7c79046f99ab35ab19f8cd9209ba8b6c75f42be031e82f1cef4a875249cd2e846a74c5401a798b3036bad96386ade2ce5b6'
7
+ data.tar.gz: 9d9952f1adfdfd15320946b6416ae84a5c1f10c1b2a7a81eb972dc184e36f18684674cc7129afaa1a97b877c546febf412112ddec6e74b64278111cdabc30456
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ 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
+
14
+ ## [0.8.0] - 2026-03-13
15
+
16
+ ### Changed
17
+
18
+ - **Default API URL updated to `https://api.mbuzz.co/api/v1`** — traffic now routes through the edge ingest proxy for improved reliability. The previous URL (`https://mbuzz.co/api/v1`) remains supported as a configurable fallback via `api_url`.
19
+
8
20
  ## [0.7.4] - 2026-02-17
9
21
 
10
22
  ### Fixed
data/README.md CHANGED
@@ -197,7 +197,7 @@ run MyApp
197
197
  ```ruby
198
198
  Mbuzz.init(
199
199
  api_key: "sk_live_...", # Required - from mbuzz.co dashboard
200
- api_url: "https://mbuzz.co/api/v1", # Optional - API endpoint
200
+ api_url: "https://api.mbuzz.co/api/v1", # Optional - API endpoint
201
201
  debug: false # Optional - enable debug logging
202
202
  )
203
203
  ```
@@ -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
@@ -26,7 +26,7 @@ module Mbuzz
26
26
  ].freeze
27
27
 
28
28
  def initialize
29
- @api_url = "https://mbuzz.co/api/v1"
29
+ @api_url = "https://api.mbuzz.co/api/v1"
30
30
  @enabled = true
31
31
  @debug = false
32
32
  @timeout = 5
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.7.5"
4
+ VERSION = "0.8.1"
5
5
  end
data/lib/mbuzz.rb CHANGED
@@ -42,7 +42,7 @@ module Mbuzz
42
42
 
43
43
  # New simplified configuration method (v0.5.0)
44
44
  # @param api_key [String] Your mbuzz API key
45
- # @param api_url [String, nil] Override API URL (defaults to https://mbuzz.co/api/v1)
45
+ # @param api_url [String, nil] Override API URL (defaults to https://api.mbuzz.co/api/v1)
46
46
  # @param session_timeout [Integer, nil] Session timeout in seconds
47
47
  # @param debug [Boolean, nil] Enable debug logging
48
48
  # @param skip_paths [Array<String>, nil] Additional paths to skip tracking (e.g., ["/admin", "/internal"])
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.7.5
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbuzz team