mbuzz 0.8.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c505c0b0158b298f75611d2a8fe9ecb2682c869da57eacc3bd1b4d74d13a7f2
4
- data.tar.gz: 3cc79da1b2ec0afbabf7e1ab9d965688da2445f57d4d930ad9a6979649a4b667
3
+ metadata.gz: 58bb33f56016e563027651d3fe6e0d5a8bd55a5b51e9920693a74b380380612a
4
+ data.tar.gz: 169f9818380dad8e239311ed1bd9c3501eb96b24d3f650a90679af1ad91630d0
5
5
  SHA512:
6
- metadata.gz: 25d6e828fb41cd61e5a83ddd372368b31fee3629f4c1a42decf313f63ae68bf18a505101efd4e0da10dbcb2cc584e6b4591448e73853e2d6bbd42aab5478bb70
7
- data.tar.gz: 6dd0b561d3d17ed20ad41e67993f45a24902fe1a7076da9c7077e02a88a5e45be613a898fb7e1728032e38d6e79ccd2af231bbda4c185db7789bdd832f18e7d5
6
+ metadata.gz: 684d91a340148e2a0762a476c401b9c8dc21f0bbff61882c8740394cc00ff72ea7ed65264f0d37880bac055e8add2b62548d4b6b474b427fe3fb8d03544d126e
7
+ data.tar.gz: 446e948eb88580966f4aaa9e5e0757510e7569f84fecf6bd1967c8ac364745b445e71484584807ae525f298b2b6e939bdeff6357982b47d1bf3cea3c79145808
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.2] - 2026-03-15
9
+
10
+ ### Changed
11
+
12
+ - **Removed `api_url` from `init()` parameters** — the proxy URL (`https://api.mbuzz.co/api/v1`) is now hardcoded. This prevents accidental bypass of the edge ingest proxy. For development, `Mbuzz.config.api_url` can still be set directly after init.
13
+
14
+ ## [0.8.1] - 2026-03-16
15
+
16
+ ### Fixed
17
+
18
+ - **`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.
19
+
8
20
  ## [0.8.0] - 2026-03-13
9
21
 
10
22
  ### 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.2"
5
5
  end
data/lib/mbuzz.rb CHANGED
@@ -42,14 +42,12 @@ 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://api.mbuzz.co/api/v1)
46
45
  # @param session_timeout [Integer, nil] Session timeout in seconds
47
46
  # @param debug [Boolean, nil] Enable debug logging
48
47
  # @param skip_paths [Array<String>, nil] Additional paths to skip tracking (e.g., ["/admin", "/internal"])
49
48
  # @param skip_extensions [Array<String>, nil] Additional extensions to skip (e.g., [".pdf"])
50
- def self.init(api_key:, api_url: nil, session_timeout: nil, debug: nil, skip_paths: nil, skip_extensions: nil)
49
+ def self.init(api_key:, session_timeout: nil, debug: nil, skip_paths: nil, skip_extensions: nil)
51
50
  config.api_key = api_key
52
- config.api_url = api_url if api_url
53
51
  config.session_timeout = session_timeout if session_timeout
54
52
  config.debug = debug unless debug.nil?
55
53
  config.skip_paths = skip_paths if skip_paths
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbuzz team