fix(android): voip accept and decline button hidden and touch not working - #7533
fix(android): voip accept and decline button hidden and touch not working#7533OtavioStasiak wants to merge 3 commits into
Conversation
WalkthroughIn-app notifications now remain visible by default when pressed unless configured otherwise. The notifier conditionally adds press handling, while incoming-call controls use dedicated layout wrappers and shared button sizing. ChangesNotification behavior and controls
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/containers/InAppNotification/IncomingCallNotification/index.tsx (1)
89-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd explicit
voidreturn types to the modified handlers.Proposed change
- onPress={() => { + onPress={(): void => {Apply this to all three
onPresscallbacks. As per coding guidelines, “add explicit type annotations to function parameters and return types.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/containers/InAppNotification/IncomingCallNotification/index.tsx` around lines 89 - 119, Update all three modified onPress callbacks in the incoming call notification to declare an explicit void return type, while preserving their existing audio, notification, cancel-call, and accept-call actions.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/containers/InAppNotification/IncomingCallNotification/index.tsx`:
- Around line 89-119: Update all three modified onPress callbacks in the
incoming call notification to declare an explicit void return type, while
preserving their existing audio, notification, cancel-call, and accept-call
actions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 48a7a728-1af0-4d79-875d-d2a353a9fc72
📒 Files selected for processing (4)
app/containers/InAppNotification/IncomingCallNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/style.tsxapp/containers/InAppNotification/index.tsxpatches/react-native-notifier+1.6.1.patch
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: ESLint and Test / run-eslint-and-test
- GitHub Check: format
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Use descriptive names for functions, variables, and classes that clearly convey their purpose
Write comments that explain the 'why' behind code decisions, not the 'what'
Keep functions small and focused on a single responsibility
Use const by default, let when reassignment is needed, and avoid var
Prefer async/await over .then() chains for handling asynchronous operations
Use explicit error handling with try/catch blocks for async operations
Avoid deeply nested code; refactor complex logic into helper functions
Files:
app/containers/InAppNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/style.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript for type safety; add explicit type annotations to function parameters and return types
Prefer interfaces over type aliases for defining object shapes in TypeScript
Use enums for sets of related constants rather than magic strings or numbers
Files:
app/containers/InAppNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/style.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{js,jsx,ts,tsx}: Before committing changes to JavaScript or TypeScript files, runpnpm prettier-lintandTZ=UTC pnpm testfor the modified files.
Use the local-first data flow: the UI reads from WatermelonDB, while sagas synchronize data with the server.
Use Redux and Redux-Saga for global or server state, and use Zustand for feature-local stores; do not assume all state is in Redux.
Files:
app/containers/InAppNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/style.tsx
🧠 Learnings (3)
📚 Learning: 2026-04-30T17:07:51.020Z
Learnt from: diegolmello
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7274
File: app/lib/services/voip/MediaCallEvents.ts:0-0
Timestamp: 2026-04-30T17:07:51.020Z
Learning: In this Rocket.Chat React Native codebase, the ESLint rule `no-void: error` is enforced. When you see a promise returned from an async call that is not awaited (a “floating promise”), do not silence it with the `void somePromise()` pattern. Instead, handle the promise explicitly by attaching `.catch(...)` (or otherwise awaiting/handling the error) so unhandled-rejection risks are addressed in a way that satisfies the existing ESLint configuration.
Applied to files:
app/containers/InAppNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/style.tsx
📚 Learning: 2026-06-25T18:37:44.793Z
Learnt from: diegolmello
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7434
File: app/views/ScreenLockConfigView.tsx:101-141
Timestamp: 2026-06-25T18:37:44.793Z
Learning: In the Rocket.Chat React Native codebase, do not treat passing an `async` function directly to an event prop in React/React Native UI components (e.g., `onPress={async () => ...}` in TSX) as a “floating promises” CI-blocking lint issue—this repo does not enable the ESLint `no-floating-promises` rule (while `no-void` is enforced). Only raise robustness follow-ups when there are genuinely unhandled promise paths (e.g., fire-and-forget calls like `save()` that return a Promise that is neither awaited nor handled), and prefer making sure failure paths are explicitly handled/reported rather than blocking on lint-style floating-promise concerns.
Applied to files:
app/containers/InAppNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/index.tsxapp/containers/InAppNotification/IncomingCallNotification/style.tsx
📚 Learning: 2026-05-05T21:08:33.177Z
Learnt from: diegolmello
Repo: RocketChat/Rocket.Chat.ReactNative PR: 7298
File: patches/@rocket.chat+sdk+1.3.3-mobile.patch:79-79
Timestamp: 2026-05-05T21:08:33.177Z
Learning: In the RocketChat/Rocket.Chat.ReactNative repo, for patches under patches/*.patch (especially those touching rocket.chat/sdk), remember that the patching sandbox's node_modules reflects the pre-patch state. Grepping node_modules for symbols (e.g., userDisconnectCloseCode = 4000 in node_modules/rocket.chat/sdk/lib/drivers/ddp.ts) can yield false positives. Review patches by inspecting the diff and applying it to a fresh copy of the SDK or diffing against the SDK source, rather than relying on node_modules. Ensure the patch actually introduces/updates symbols in the SDK source and run the test suite to validate behavior after applying the patch.
Applied to files:
patches/react-native-notifier+1.6.1.patch
🔇 Additional comments (3)
patches/react-native-notifier+1.6.1.patch (1)
8-9: LGTM!Also applies to: 17-18, 26-26, 35-35, 46-63, 74-75
app/containers/InAppNotification/IncomingCallNotification/style.tsx (1)
6-6: LGTM!Also applies to: 30-60
app/containers/InAppNotification/index.tsx (1)
63-64: 📐 Maintainability & Code QualityRun the required checks before commit.
The required
pnpm prettier-lintandTZ=UTC pnpm testresults are not available; rerun these checks until both complete successfully before merging.
|
Android Build Available Rocket.Chat 4.75.0.109467 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNS8Yxhc8fR9t4WQU9mAsIYN2x_VVKJLdzwEzcbfY5GXMB5HXW04y0IJXJMPhFz-JbLuoV2RzmVIDfKQdEXK |
|
Android Build Available Rocket.Chat 4.76.0.109492 Internal App Sharing: https://play.google.com/apps/test/RQQ8k09hlnQ/ahAO29uNQGQmbTK27fSLFeHRens3Iv4H5bphYPco0L6S1AaDLj6Jjs5n5BknxzbqjmL7V6LN38g5dLc4YsDMPpSlFA |
Proposed changes
1. Fix Android notification buttons not responding to taps
Root cause
react-native-notifierwraps every notification body in aTouchableWithoutFeedbackto support itshideOnPress/onPressbehavior. Our notification content rendersTouch, which usesRectButtonfromreact-native-gesture-handler.On Android, once the touch stream contains movement, the ancestor
TouchableWithoutFeedback(React Native Pressability) claims the responder. This cancels the descendantRectButtongesture, causingNativeViewGestureHandlerto reject activation onACTION_UP. As a result, the buttons appear pressable (and may even show a ripple), butonPressis never fired.Solution
patches/react-native-notifier+1.6.1.patchpressableflag computed when showing a notification:TouchableWithoutFeedbackwrapper only when the notification actually needs press handling.View, avoiding the Pressability responder conflict.app/containers/InAppNotification/index.tsxhideOnPress: true.2. Fix invisible Decline / Accept buttons
Root cause
Touchonly forwards a subset of style properties (backgroundColor,borderRadius, and margins) to the underlyingRectButton. Layout properties such asflex,width,height,alignItems, andjustifyContentare applied to an innerViewinstead.As a result, the
RectButtonitself had no size, collapsed to zero dimensions, and the Decline / Accept buttons became invisible. Layout-related styles must instead be passed throughrectButtonStyle.Solution
style→ visual properties (backgroundColor,borderRadius,marginRight)rectButtonStyle→ layout and sizing propertiescloseButtonContainer36 × 36sizebuttonContainerminHeight: 36minHeightinstead of a fixed height to better support larger accessibility font sizesflex: 1, allowing both buttons to evenly share the available width.36 × 36action.BUTTON_HEIGHT = 36as a shared constant.Touch/RectButtonstyle forwarding behaviorflexandminHeightlayout decisions.Issue(s)
https://rocketchat.atlassian.net/browse/SUP-1090
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit
New Features
Bug Fixes