Skip to content

feat: implement app version auto-update mechanism - #574

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
collinsezedike:feat/issue-356-app-auto-update
Jun 25, 2026
Merged

feat: implement app version auto-update mechanism#574
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
collinsezedike:feat/issue-356-app-auto-update

Conversation

@collinsezedike

Copy link
Copy Markdown
Contributor

What this does

Closes #356.

Adds an in-app update system that checks for new versions on startup and prompts users to install with one tap, satisfying all acceptance criteria:

  • Version check on app start - AppUpdateService.checkForUpdate() runs on mount via UpdateChecker in the root layout. A 24-hour interval guard (shouldCheck()) prevents redundant calls on every launch.
  • Update available notification - UpdateNotificationModal renders an accessible modal with the update description and optional release notes. Mandatory updates block dismissal.
  • One-click OTA update - For JS-only bundle changes, the modal's "Install Now" button calls fetchUpdateAsync() then reloadAsync() via expo-updates (dynamically imported, so the app won't crash before the package is added to a native build). Native/binary changes fall back to a "Open App Store / Open Play Store" path using the store URLs already defined in app.json.
  • Update adoption tracking - mobileAnalyticsService.trackEvent fires on every stage: check started, update available/not available, download started/completed/failed, update applied, dismissed, and store redirect. Nine new UPDATE_* events added to AnalyticsEvent.
  • End-to-end test coverage - appUpdateService.test.ts (10 cases) and useAppUpdate.test.ts (9 cases) cover all state transitions, error paths, platform branching, and the mount-time auto-check.

Key files

File Role
src/services/appUpdateService.ts Core service: OTA check, download/apply, store redirect, analytics
src/hooks/useAppUpdate.ts React hook wrapping the service with loading/error state
src/components/common/UpdateNotificationModal.tsx Accessible update prompt UI
src/__mocks__/expo-updates.ts Jest mock for expo-updates
app/_layout.tsx UpdateChecker component wired into the provider tree
app.json expo-updates plugin, updates config, runtimeVersion policy
src/utils/trackingEvents.ts Nine new UPDATE_* analytics events

Notes

  • expo-updates is not yet in package.json (package installation was deferred). It needs npx expo install expo-updates before the next native build. The dynamic import means existing JS bundle runs are unaffected until then.
  • The src/services/index.ts file had stale merge-conflict prose as its content; that was corrected as part of this PR.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@collinsezedike Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project

@RUKAYAT-CODER
RUKAYAT-CODER merged commit fe05c88 into rinafcode:main Jun 25, 2026
1 of 13 checks passed
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.

Implement app version auto-update mechanism

2 participants