Skip to content

feat(feedback): add runtime shake gesture toggle API#7737

Closed
antonis wants to merge 4 commits intomainfrom
antonis/feedback-shake-runtime
Closed

feat(feedback): add runtime shake gesture toggle API#7737
antonis wants to merge 4 commits intomainfrom
antonis/feedback-shake-runtime

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Mar 25, 2026

📜 Description

Add SentrySDK.feedback.enableShakeGesture() and SentrySDK.feedback.disableShakeGesture() for dynamic control of shake-to-report at runtime, similar to the React Native API.

This allows users to enable/disable shake gesture on specific screens or app contexts without restarting the SDK.

💡 Motivation and Context

The existing useShakeGesture config is set at SDK init time and can't be changed at runtime. Users need per-screen control (e.g., enable in settings, disable in checkout).

Builds on #7579 which added the initial shake gesture detection.

💚 How did you test it?

  • Unit tests: 8/8 shake detector tests pass including new re-enable cycle test
  • Local verification: make format, make analyze, make build-ios, all pass
  • Manual testing: verified shake gesture toggle in iOS simulator

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Add SentrySDK.feedback.enableShakeGesture() and
disableShakeGesture() for dynamic control at runtime.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (feedback) Add runtime shake gesture toggle API by antonis in #7737

Documentation 📚

  • Add SentryCrash analysis and improvement plan document by itaybre in #7528

Internal Changes 🔧

Deps

  • Bump activesupport from 7.2.3 to 7.2.3.1 by dependabot in #7732
  • Bump fastlane-plugin-sentry from 2.3.0 to 2.4.0 by dependabot in #7724
  • Bump ruby/setup-ruby from 1.292.0 to 1.295.0 by dependabot in #7728
  • Bump getsentry/craft from 2.24.1 to 2.25.0 by dependabot in #7729
  • Bump codecov/codecov-action from 5.5.2 to 5.5.3 by dependabot in #7725
  • Bump actions/create-github-app-token from 2.2.1 to 3.0.0 by dependabot in #7726
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.24.1 to 2.25.0 by dependabot in #7727
  • Bump json from 2.18.1 to 2.19.2 by dependabot in #7709

Other

  • Pin GitHub Actions to full-length commit SHAs by joshuarli in #7730

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against f1890ca

antonis added 2 commits March 25, 2026 09:04
Remove existing shake observer before adding in enableShakeGesture()
to prevent duplicate notifications on repeated calls or when
useShakeGesture was set at init. Add test-only cooldown reset to
eliminate 1.1s sleep in re-enable test.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.047%. Comparing base (59aa682) to head (f1890ca).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...Feedback/SentryUserFeedbackIntegrationDriver.swift 0.000% 8 Missing ⚠️
.../Integrations/UserFeedback/SentryFeedbackAPI.swift 0.000% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #7737       +/-   ##
=============================================
- Coverage   85.375%   85.047%   -0.328%     
=============================================
  Files          487       487               
  Lines        28985     28999       +14     
  Branches     12551     12549        -2     
=============================================
- Hits         24746     24663       -83     
- Misses        4193      4288       +95     
- Partials        46        48        +2     
Files with missing lines Coverage Δ
...ntegrations/UserFeedback/SentryShakeDetector.swift 88.888% <100.000%> (+0.653%) ⬆️
.../Integrations/UserFeedback/SentryFeedbackAPI.swift 0.000% <0.000%> (ø)
...Feedback/SentryUserFeedbackIntegrationDriver.swift 17.796% <0.000%> (-1.295%) ⬇️

... and 15 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59aa682...f1890ca. Read the comment docs.

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Mar 25, 2026

@sentry review

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Mar 25, 2026

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@antonis
Copy link
Copy Markdown
Contributor Author

antonis commented Mar 25, 2026

Closing this as we decided not to proceed with exposing this API / cc @christophaigner

@antonis antonis closed this Mar 25, 2026
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.

1 participant