Skip to content

chore(analytics): drop unnecessary export from ANALYTICS_EVENT_NAME_KEBAB_SEGMENT - #27840

Merged
mroz22 merged 1 commit into
developfrom
mroz22/dead-code-analytics
May 26, 2026
Merged

chore(analytics): drop unnecessary export from ANALYTICS_EVENT_NAME_KEBAB_SEGMENT#27840
mroz22 merged 1 commit into
developfrom
mroz22/dead-code-analytics

Conversation

@mroz22

@mroz22 mroz22 commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Drops the unnecessary public export of ANALYTICS_EVENT_NAME_KEBAB_SEGMENT from @suite-common/analytics. The constant is used internally only.

Split out from the staging dead-code PR #27551 (suite-common/* batch).

Related PRs

Sibling PRs in this batch (each removes one piece of dead code from suite-common/*):

Parent staging PR: #27551

Test plan

  • CI typecheck and tests pass

🤖 LLM Test Recommendations

Summary: The changes are in suite-common/analytics/src/eventNameValidation.ts and its barrel index.ts. These files govern analytics event name validation logic used across the Suite application. The risk is moderate — if event name validation rules change, any test that asserts on specific analytics event types or payloads could break. The recommended strategy focuses on the dedicated analytics E2E tests which directly exercise event type matching and payload validation, plus the settings/general test which also validates multiple analytics events.

Changed files (2)
  • suite-common/analytics/src/eventNameValidation.ts
  • suite-common/analytics/src/index.ts

Recommended tests (6)

🔴 High priority (2)
  • ../../suite/e2e/tests/analytics/events.test.ts — This test directly exercises analytics event types and event validation. The changed file eventNameValidation.ts likely validates analytics event names, and the index.ts re-exports this module. This test fires and validates multiple analytics events (SuiteReady, DeviceConnect, TransportType, DeviceDisconnect, settingsAnalytics) and checks their payloads, making it the most direct consumer of analytics event name infrastructure.
  • ../../suite/e2e/tests/analytics/toggle.test.ts — This test validates analytics enable/disable lifecycle, event firing (settingsAnalyticsEvent, settingsGeneralChangeFiatEvent, suiteReadyEvent, routerLocationChangeEvent), and metadata fields (c_type, c_session_id, c_instance_id). Changes to event name validation could break event type matching or event identification in these assertions.
🟡 Medium priority (4)
  • ../../suite/e2e/tests/analytics/promo-banner-events.test.ts — This test asserts that analytics payloads contain correct c_type matching EventType.PromoDashboardBanner. If eventNameValidation changes how event names are validated or formatted, this test's event type assertions could fail.
  • ../../suite/e2e/tests/analytics/staking-events.test.ts — This test validates StakingNavigate analytics events with specific c_type and networkSymbol payloads. Changes to event name validation could affect how these event types are validated or dispatched.
  • ../../suite/e2e/tests/analytics/wallet-connect-events.test.ts — This test checks WalletConnect analytics events (WalletConnectInit, WalletConnectPaired, WalletConnectProposal, etc.) by c_type. The source_hints explicitly reference '@suite-common/analytics (EventType constants)' which is the changed package. Event name validation changes could affect these event type checks.
  • ../../suite/e2e/tests/settings/general.test.ts — This test validates analytics events for fiat change, theme change, language change, and analytics toggle (settingsGeneralChangeFiatEvent, settingsGeneralChangeThemeEvent, settingsGeneralChangeLanguageEvent, settingsAnalyticsEvent). These events flow through the analytics module where event name validation applies.

⚠️ Changes with no test coverage (1)

  • suite-common/analytics/src/eventNameValidation.ts

Updated: 2026-05-17T06:44:03.837Z

🔍 Currents Test Results

🔍 Suite desktop test results: View in Currents

🔍 Suite web test results: View in Currents

🔍 Suite native android test results: View in Currents

🔒 Quarantined E2E Tests

Trezor Suite (web) — 4 test(s)
Test Type
Quarantine test: "Onboarding - create wallet,Success (basic)" 🙋 manual
Quarantine test: "Database migration,Db migration between: release/22.5/web => develop/web" 🙋 manual
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual
Quarantine test: "Recovery T2T1 - dry run,Recovery after partial recovery" 🙋 manual

Updated: 2026-05-17T06:49:02.270Z • 4 test(s) total

Trezor Suite (desktop) — 2 test(s)
Test Type
Onboarding - create wallet > Success (basic) 🤖 auto
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual

Updated: 2026-05-17T06:47:25.468Z • 2 test(s) total

🌐 Preview deployments

🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/mroz22/dead-code-analytics/web/

…EBAB_SEGMENT

(cherry picked from commit e7cf9315db6171f086a50174ed0457327da68c88)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes an internal-only analytics event-name regex from the public @suite-common/analytics barrel export while keeping validation behavior unchanged.

Changes:

  • Makes ANALYTICS_EVENT_NAME_KEBAB_SEGMENT private to eventNameValidation.ts.
  • Removes the constant from suite-common/analytics/src/index.ts exports.

Reviewed changes

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

File Description
suite-common/analytics/src/eventNameValidation.ts Keeps the regex available internally for event name validation without exporting it.
suite-common/analytics/src/index.ts Drops the unnecessary public re-export from the analytics package barrel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mroz22
mroz22 merged commit 9a55e90 into develop May 26, 2026
56 of 58 checks passed
@mroz22
mroz22 deleted the mroz22/dead-code-analytics branch May 26, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code Code improvements no-project This label is used to specify that PR doesn't need to be added to a project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants