feat(feedback): Support runtime enable/disable of shake-to-report - #5827
feat(feedback): Support runtime enable/disable of shake-to-report#5827markushi wants to merge 10 commits into
Conversation
|
📲 Install BuildsAndroid
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 22f4345 | 307.87 ms | 354.51 ms | 46.64 ms |
| 8c7718c | 307.42 ms | 374.84 ms | 67.42 ms |
| bb0ff41 | 321.00 ms | 378.28 ms | 57.28 ms |
| c8125f3 | 397.65 ms | 485.14 ms | 87.49 ms |
| eb95ded | 317.51 ms | 369.08 ms | 51.57 ms |
| f634d01 | 375.06 ms | 420.04 ms | 44.98 ms |
| 9fbb112 | 359.71 ms | 421.85 ms | 62.14 ms |
| d501a7e | 307.33 ms | 341.94 ms | 34.61 ms |
| bb0ff41 | 317.76 ms | 384.66 ms | 66.90 ms |
| 9054d65 | 330.94 ms | 403.24 ms | 72.30 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 22f4345 | 1.58 MiB | 2.29 MiB | 719.83 KiB |
| 8c7718c | 0 B | 0 B | 0 B |
| bb0ff41 | 0 B | 0 B | 0 B |
| c8125f3 | 1.58 MiB | 2.10 MiB | 532.32 KiB |
| eb95ded | 0 B | 0 B | 0 B |
| f634d01 | 1.58 MiB | 2.10 MiB | 533.40 KiB |
| 9fbb112 | 1.58 MiB | 2.11 MiB | 539.18 KiB |
| d501a7e | 0 B | 0 B | 0 B |
| bb0ff41 | 0 B | 0 B | 0 B |
| 9054d65 | 1.58 MiB | 2.29 MiB | 723.38 KiB |
Previous results on branch: feat/runtime-enable-disable-shake-to-report
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| be39d9f | 343.92 ms | 417.98 ms | 74.06 ms |
| ad80f17 | 315.06 ms | 364.31 ms | 49.24 ms |
| d65301f | 330.76 ms | 381.63 ms | 50.88 ms |
| 8594d29 | 355.30 ms | 449.74 ms | 94.44 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| be39d9f | 0 B | 0 B | 0 B |
| ad80f17 | 0 B | 0 B | 0 B |
| d65301f | 0 B | 0 B | 0 B |
| 8594d29 | 0 B | 0 B | 0 B |
…r.setDialog to prevent overlapping feedback dialogs
…e-to-report' into feat/runtime-enable-disable-shake-to-report
…strong dialog reference cannot leak its activity
…nt stacked feedback dialogs
…g callback cannot crash the app
runningcode
left a comment
There was a problem hiding this comment.
Looks good, just some small things!
- Scope shake suppression to the activity a feedback form is showing on, instead of a global paused flag. A dialog lives in its activity's window and is never notified when that activity is backgrounded, so tracking the owning activity removes the lifecycle heuristics entirely - Re-check enabled on shake dispatch so a concurrent disableOnShake() cannot still show a form - Narrow user-callback guards from Throwable to Exception so Errors propagate - Rename isFeedbackOnShakeEnabled() to isOnShakeEnabled() for consistency with enableOnShake()/disableOnShake(), and drop @ApiStatus.Internal Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e5d6f39. Configure here.
| } | ||
| previousOnFormClose = null; | ||
| } | ||
| } |
There was a problem hiding this comment.
Form unpause clobbers another form
Medium Severity
setOnShakePaused keeps only one formActivityRef and clears it unconditionally on unpause. Cross-activity shake is now allowed while a backgrounded form still exists, so a second form’s pause/unpause overwrites or clears the first form’s slot. Returning to that earlier activity, or destroying it while another form is visible, can re-arm detection and stack another dialog.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e5d6f39. Configure here.


📜 Description
Adds a runtime API to toggle shake-to-report after
Sentry.init():Sentry.feedback().enableFeedbackOnShake()Sentry.feedback().disableFeedbackOnShake()SentryFeedbackOptions.isUseShakeGesture()now only determines the initial state; the runtime API overrides it afterwards. Propagation works similar toIFormHandler/ReplayControllerby introducing a newSentryFeedbackOptions.IShakeController.This also required a bit of re-wiring on-demand Dialogs vs. the automatic ones, so no duplicate Dialogs are shown and no duplicate detectors run at the same time. The dialogs now report back to the
IShakeController, which now is the only component which takes care of starting/stopping shake detection.💡 Motivation and Context
Having a runtime option to enable / disable the feedback.
Closes #5486 (#5486)
💚 How did you test it?
Unit tests + Manual Tests.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
FeedbackShakeIntegrationso there's a single detector/arbitration point