Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: screen events and autocapture should ignore keyboard window #269

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

ioannisj
Copy link
Contributor

@ioannisj ioannisj commented Dec 3, 2024

💡 Motivation and Context

Original thread: https://posthog.slack.com/archives/C0113360FFV/p1733238766585229
Ticket: https://posthoghelp.zendesk.com/agent/tickets/21072

Problem

It seems that we were unintentionally capturing view controllers belonging to the keyboard window when sending $screen events. While this might not be a significant issue under normal circumstances, for applications that are message- or form-heavy, this behavior could result in inflated autocapture event volumes.

Fix

  • Updated logic to ignore any UIView or UIViewController that belongs to the keyboard window
  • Added a similar logic got $autocapture events + some minor improvements

💚 How did you test it?

Sample project

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

@ioannisj ioannisj requested a review from marandaneto as a code owner December 3, 2024 16:54
@ioannisj ioannisj requested a review from a team December 3, 2024 16:54
@ioannisj ioannisj merged commit be00f15 into main Dec 5, 2024
6 checks passed
@ioannisj ioannisj deleted the fix/autocapture-keyboard-window branch December 5, 2024 09:44
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.

2 participants