Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spicy-baboons-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-next': patch
---

Added missing telemetry metric.
4 changes: 3 additions & 1 deletion packages/browser/src/browser/__tests__/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ describe('Dispatch', () => {
})

await sleep(10)
expect(fetchCalls[1].url).toBe('http://new.api.io/m')
expect(fetchCalls.some((call) => call.url === 'http://new.api.io/m')).toBe(
true
)
})
})

Expand Down
1 change: 1 addition & 0 deletions packages/browser/src/core/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ export class Analytics
callback?: Callback
): Promise<DispatchedEvent> {
const ctx = new Context(event)
ctx.stats.increment('analytics_js.invoke', 1, [event.type])
if (isOffline() && !this.options.retryQueue) {
return ctx
}
Expand Down
Loading