Skip to content

feat: pulse events batching#4950

Merged
enesozturk merged 14 commits intomainfrom
feat/events-batching
Sep 4, 2025
Merged

feat: pulse events batching#4950
enesozturk merged 14 commits intomainfrom
feat/events-batching

Conversation

@ganchoradkov
Copy link
Copy Markdown
Member

@ganchoradkov ganchoradkov commented Sep 3, 2025

Description

This PR implements pulse events batching to improve analytics performance by accumulating events and submitting them in batches via navigator.sendBeacon. The implementation automatically submits events when the page becomes hidden or when a size limit is reached.

Key changes:

  • Replaces immediate event submission with batching mechanism
  • Adds automatic submission on visibility change events
  • Implements size-based auto-submission (45KB limit)

https://www.notion.so/walletconnect/Reducing-pulse-api-calls-from-AppKit-2613a661771e8050b338c2b9c83d9b54#2613a661771e8050b338c2b9c83d9b54

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

https://linear.app/reown/issue/APKT-3720/appkit-pulse-events-batching

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copilot AI review requested due to automatic review settings September 3, 2025 09:46
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 3, 2025

🦋 Changeset detected

Latest commit: 9f3f3af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@reown/appkit-universal-connector Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-wallet-button Patch
@reown/appkit-utils Patch
@reown/appkit-experimental Patch
@reown/appkit-controllers Patch
@reown/appkit-core Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-polyfills Patch
@reown/appkit-codemod Patch
@reown/appkit-testing Patch
@reown/appkit Patch
@reown/appkit-common Patch
@reown/appkit-wallet Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-pay Patch
@reown/appkit-ui Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
appkit-basic-html Ready Ready Preview Comment Sep 4, 2025 6:48am
appkit-demo Ready Ready Preview Comment Sep 4, 2025 6:48am
appkit-gallery Ready Ready Preview Comment Sep 4, 2025 6:48am
appkit-laboratory Ready Ready Preview Comment Sep 4, 2025 6:48am
10 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
appkit-basic-example Ignored Ignored Sep 4, 2025 6:48am
appkit-basic-sign-client-example Ignored Ignored Sep 4, 2025 6:48am
appkit-basic-up-example Ignored Ignored Sep 4, 2025 6:48am
appkit-ethers5-bera Ignored Ignored Sep 4, 2025 6:48am
appkit-nansen-demo Ignored Ignored Sep 4, 2025 6:48am
appkit-vue-solana Ignored Ignored Sep 4, 2025 6:48am
appkit-wagmi-cdn-example Ignored Ignored Sep 4, 2025 6:48am
ethereum-provider-wagmi-example Ignored Ignored Sep 4, 2025 6:48am
next-wagmi-solana-bitcoin-example Ignored Ignored Sep 4, 2025 6:48am
vue-wagmi-example Ignored Ignored Sep 4, 2025 6:48am

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements pulse events batching to improve analytics performance by accumulating events and submitting them in batches via navigator.sendBeacon. The implementation automatically submits events when the page becomes hidden or when a size limit is reached.

Key changes:

  • Replaces immediate event submission with batching mechanism
  • Adds automatic submission on visibility change events
  • Implements size-based auto-submission (45KB limit)

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
EventsController.test.ts Comprehensive test coverage for batching functionality and visibility change handling
TypeUtil.ts Adds PendingEvent type definition for batched events
FetchUtil.ts Adds sendBeacon method for batch submission
EventsController.ts Core implementation of events batching and submission logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 3, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.33% 34875 / 44522
🔵 Statements 78.33% 34875 / 44522
🔵 Functions 76.1% 3842 / 5048
🔵 Branches 86.64% 8226 / 9494
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/controllers/src/controllers/EventsController.ts 95.45% 97.56% 90.9% 95.45% 90-91, 135-137
packages/controllers/src/utils/FetchUtil.ts 100% 87.87% 100% 100%
Generated in workflow #14827 for commit 9f3f3af by the Vitest Coverage Report Action

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

ganchoradkov and others added 2 commits September 4, 2025 09:41
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ganchoradkov ganchoradkov added this pull request to the merge queue Sep 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 4, 2025
@enesozturk enesozturk added this pull request to the merge queue Sep 4, 2025
Merged via the queue into main with commit 756a3ee Sep 4, 2025
41 checks passed
@enesozturk enesozturk deleted the feat/events-batching branch September 4, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants