Skip to content

chore: replace react-native-background-timer with plain setInterval#7488

Merged
diegolmello merged 1 commit into
chore/rn-0.83-expo-55from
chore/deinterop-background-timer
Jul 13, 2026
Merged

chore: replace react-native-background-timer with plain setInterval#7488
diegolmello merged 1 commit into
chore/rn-0.83-expo-55from
chore/deinterop-background-timer

Conversation

@diegolmello

@diegolmello diegolmello commented Jul 10, 2026

Copy link
Copy Markdown
Member

Proposed changes

react-native-background-timer is an interop-only native module, unmaintained since 2020, with no New-Architecture (TurboModule/Fabric) path. On RN 0.83 / Expo 55 it survives only because the default-on interop layer carries it, making it a first-to-break liability on future RN bumps.

Its sole consumer is videoConfTimer — the classic-Jitsi 10s keep-alive heartbeat, which runs only while the JitsiMeetView is in the foreground. Foreground-only timing needs no native module, so this rewrites it on plain setInterval/clearInterval and removes the dependency, its @types package and the autolinked iOS pod.

Trade-off: the module's background continuation (~30s on iOS after backgrounding) is lost. Negligible here — the legacy Jitsi heartbeat backs a foreground WebView call, and the accepted decision covers it.

Issue(s)

Part of the RN 0.83 / Expo 55 upgrade hardening — https://rocketchat.atlassian.net/browse/NATIVE-1234

How to test or reproduce

  1. Build and run on iOS or Android.
  2. Join a server whose video-conference provider is classic Jitsi, then start a call so JitsiMeetView mounts.
  3. Observe network traffic: POST video-conference/jitsi.update-timeout fires immediately, then every ~10s while the call is foregrounded, and stops on call end.

Screenshots

n/a — no visible UI change.

Types of changes

  • Improvement (non-breaking change which improves a current function)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Verified: pnpm install (−79 pkgs) + pnpm pod-install clean, pod dropped from Podfile.lock; pnpm lint (eslint + tsc) 0 errors; iOS build succeeds and app boots on the simulator — confirming autolinking is unaffected by removing the native module. The live in-call Jitsi heartbeat (step 3 above) was not exercised, as it needs a server configured with Jitsi as the videoconf provider; the change is a pure JS-builtin timer swap, so build + boot covers the native-removal risk.

Targets the RN 0.83 / Expo 55 integration branch (chore/rn-0.83-expo-55, #7481).

Summary by CodeRabbit

  • Bug Fixes
    • Improved video conference timer reliability by using standard timer handling.
    • Ensured timers are properly cleared when a video conference ends.
  • Chores
    • Removed an unused background timer dependency.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07cf0734-6182-4252-a759-2b55d156c375

📥 Commits

Reviewing files that changed from the base of the PR and between 8223269 and 9e9f860.

⛔ Files ignored due to path filters (2)
  • ios/Podfile.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • app/lib/methods/videoConfTimer.ts
  • package.json
💤 Files with no reviewable changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/lib/methods/videoConfTimer.ts

Walkthrough

The video conference timer replaces background timer APIs with standard JavaScript interval APIs and removes the corresponding runtime and type dependencies.

Changes

Video conference timer migration

Layer / File(s) Summary
Standardize video conference timer intervals
app/lib/methods/videoConfTimer.ts, package.json
The timer uses setInterval and clearInterval with an updated handle type, while the background timer packages are removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: replacing react-native-background-timer with setInterval.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (2)
  • NATIVE-1234: Request failed with status code 401
  • EXPO-55: Request failed with status code 401

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

react-native-background-timer is interop-only and dead since 2020, with no
new-arch path. Its sole consumer (videoConfTimer, the classic-Jitsi 10s
heartbeat) only needs foreground timers, so rewrite it on plain
setInterval/clearInterval and drop the dependency, its @types package and the
autolinked iOS pod.

Trade-off: background continuation (~30s on iOS) is lost; negligible for the
foreground-only legacy Jitsi keep-alive.
@diegolmello diegolmello force-pushed the chore/deinterop-background-timer branch from 8223269 to 9e9f860 Compare July 10, 2026 19:24
@diegolmello diegolmello temporarily deployed to approve_e2e_testing July 10, 2026 19:24 — with GitHub Actions Inactive
@diegolmello diegolmello merged commit 4ee6f65 into chore/rn-0.83-expo-55 Jul 13, 2026
33 of 39 checks passed
@diegolmello diegolmello deleted the chore/deinterop-background-timer branch July 13, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant