Skip to content

fix: await analytics reporting methods#2443

Closed
cookesan wants to merge 1 commit into
wxt-dev:mainfrom
cookesan:analytics-promise-methods
Closed

fix: await analytics reporting methods#2443
cookesan wants to merge 1 commit into
wxt-dev:mainfrom
cookesan:analytics-promise-methods

Conversation

@cookesan

Copy link
Copy Markdown
Contributor

Description

Makes the public analytics reporting API return promises for track, page, identify, and setEnabled, matching the documented await analytics.track(...) usage. Foreground calls now resolve from a background-port acknowledgment after the background handler finishes, and reject when that handler fails.

This also allows analytics.page() with no location and keeps foreground metadata separate from optional analytics payload arguments.

Linked Issues

fixes #2408

Checks

  • bun run --filter @wxt-dev/analytics test run
  • bun run --filter @wxt-dev/analytics check
  • ../../node_modules/.bin/tsdown from packages/analytics
  • git diff --check
  • provenance and public-text scans

@cookesan cookesan requested a review from aklinker1 as a code owner June 28, 2026 16:03
@netlify

netlify Bot commented Jun 28, 2026

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 32e6a48
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a4145dcd8e75200092cd238
😎 Deploy Preview https://deploy-preview-2443--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the pkg/analytics Includes changes to the `packages/analytics` directory label Jun 28, 2026
@aklinker1

Copy link
Copy Markdown
Member

Closing in favor of #2409

@aklinker1 aklinker1 closed this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/analytics Includes changes to the `packages/analytics` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

await analytics.track() produces TS80007 because Analytics interface returns void instead of Promise<void>

2 participants