Skip to content

security: web-vitals & global listeners leak across SPA navigations #452

Description

@nanaf6203-bit

Summary

src/lib/mobile-optimizer.ts maintains long-task observers and PerformanceObserver instances attached at module scope, never disposing them; combined with the global addEventListener on window error / unhandledrejection (extensionDetection, earlyErrorSuppression), the app grows listener count across HMR or navigation.

Affected area

  • src/lib/mobile-optimizer.ts
  • src/utils/extensionDetection.ts
  • src/utils/earlyErrorSuppression.ts

Steps to reproduce / impact

Memory growth / listener duplication on SPA route changes is observable in DevTools Performance.

Expected behaviour

Tee observer registration through a per-app lifecycle hook.

Acceptance criteria

  • Single observer per app.
  • Counters reset in tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programperformancePerformance / bundle / runtimepriority/p2P2 — medium prioritysecuritySecurity issue or hardening opportunity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions