posthog-ruby 3.26.0 → 3.26.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/lib/posthog/client.rb +3 -2
- data/lib/posthog/mcp/instrumentation.rb +9 -1
- data/lib/posthog/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: 0d946132227412308da5d7398c0e0098eccdbaa69dab46f8110ceeff96326917
|
|
4
|
+
data.tar.gz: 99025d3aedc7092f8f00809511d7f884a372c2277939a41d61a83d177ceaa690
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68c02002baccb2ecd186dff40234c856b5445a9227fdb197deb40ddc08179734a724d4d1b7e2d70eef9588b437cd02d3cfb55f636ab245a710616860e7e77daf
|
|
7
|
+
data.tar.gz: 8b80a2f46d15ac4bdf44f52101d031e5c5fb052625dd957a2fbf853ebff8069116f3b89359769e98980b33bf8677690fb20a4ae22bf35666260108914dde6856
|
data/lib/posthog/client.rb
CHANGED
|
@@ -187,7 +187,8 @@ module PostHog
|
|
|
187
187
|
|
|
188
188
|
# Warn when multiple clients are created with the same API key (can cause dropped events)
|
|
189
189
|
unless @disabled || opts[:test_mode] || opts[:disable_singleton_warning]
|
|
190
|
-
previous_count =
|
|
190
|
+
previous_count = PostHog::Client._increment_instance_count(@api_key)
|
|
191
|
+
@instance_registered = true
|
|
191
192
|
if previous_count >= 1
|
|
192
193
|
logger.warn(
|
|
193
194
|
'Multiple PostHog client instances detected for the same API key. ' \
|
|
@@ -947,7 +948,7 @@ module PostHog
|
|
|
947
948
|
|
|
948
949
|
flushed = false
|
|
949
950
|
begin
|
|
950
|
-
|
|
951
|
+
PostHog::Client._decrement_instance_count(@api_key) if @instance_registered
|
|
951
952
|
@feature_flags_poller&.shutdown_poller
|
|
952
953
|
flushed =
|
|
953
954
|
if @sync_mode
|
|
@@ -226,11 +226,19 @@ module PostHog
|
|
|
226
226
|
|
|
227
227
|
safely do
|
|
228
228
|
session_id = prepare_request(@request)
|
|
229
|
-
record_tools_list(session_id, names: names, response: result, empty: empty)
|
|
229
|
+
record_tools_list(session_id, names: names, response: tools_list_envelope(result), empty: empty)
|
|
230
230
|
end
|
|
231
231
|
result
|
|
232
232
|
end
|
|
233
233
|
|
|
234
|
+
# `resultType` is a lifecycle discriminator the gem stamps on every modern-wire reply, not envelope data.
|
|
235
|
+
def tools_list_envelope(result)
|
|
236
|
+
return nil unless result.is_a?(Hash)
|
|
237
|
+
|
|
238
|
+
envelope = result.reject { |key, value| %w[tools resultType].include?(key.to_s) || value.nil? }
|
|
239
|
+
envelope unless envelope.empty?
|
|
240
|
+
end
|
|
241
|
+
|
|
234
242
|
def dispatch_initialize
|
|
235
243
|
client_info = fetch(@params, :clientInfo)
|
|
236
244
|
client_name = client_info.is_a?(Hash) ? fetch(client_info, :name) : nil
|
data/lib/posthog/version.rb
CHANGED