App icon indicating copy to clipboard operation
App copied to clipboard

Upgrade @react-native-clipboard/clipboard to latest

Open roryabraham opened this issue 1 month ago • 27 comments

Problem

align-deps indicates that we must upgrade @react-native-clipboard/clipboard in order to upgrade React Native.

Solution

Bump @react-native-clipboard/clipboard package to latest.

Issue OwnerCurrent Issue Owner: @mollfpr

roryabraham avatar Nov 20 '25 19:11 roryabraham

Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)

melvin-bot[bot] avatar Nov 20 '25 19:11 melvin-bot[bot]

Triggered auto assignment to @lydiabarclay (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Nov 20 '25 19:11 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

We need to update the package @react-native-clipboard/clipboard

What is the root cause of that problem?

React Native 0.82 requires a newer version of @react-native-clipboard/clipboard. Since the package is not updated, the dependency alignment fails, preventing the React Native upgrade.

What changes do you think we should make in order to solve the problem?

Update @react-native-clipboard/clipboard to the latest stable version in package.json, reinstall dependencies, and ensure the clipboard functionality continues to work correctly on both Android and iOS.

# Remove old version (optional)
yarn remove @react-native-clipboard/clipboard
# or
npm uninstall @react-native-clipboard/clipboard

# Install latest version
yarn add @react-native-clipboard/clipboard
# or
npm install @react-native-clipboard/clipboard


What alternative solutions did you explore? (Optional)

N/A

AQIB-NAWAB avatar Nov 20 '25 19:11 AQIB-NAWAB

Proposal

Please re-state the problem that we are trying to solve in this issue.

Upgrade @react-native-clipboard/clipboard to latest

What is the root cause of that problem?

Bump @react-native-clipboard/clipboard package to latest.

What changes do you think we should make in order to solve the problem?

We should

  • Update package.json Change the version from "^1.15.0" to "^1.16.3" (latest version)
  • npm install
  • Update iOS dependencies npm run pod-install (if applicable)
  • And Run the align-deps check to confirm it's satisfied

npx react-native-align-deps

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

samranahm avatar Nov 20 '25 19:11 samranahm

⚠️ @abbasifaizan70 Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

github-actions[bot] avatar Nov 20 '25 19:11 github-actions[bot]

Please re-state the problem that we are trying to solve in this issue.

The align-deps tool is blocking the React Native upgrade because our current react-navigation packages are incompatible with the target React Native version. We need to upgrade react-navigation to proceed with the React Native upgrade.

What is the root cause of that problem?

The problem exists because the version of @react-native-clipboard/clipboard currently in your app was built for React Native ≤0.81 and depends on native APIs that were deprecated and removed in RN 0.82. When align-deps simulates the RN upgrade, it finds that this older clipboard module declares peer dependencies and native code that no longer compile against the new React Native headers. In short, React Native 0.82 drops support for the native bridge methods that the older clipboard package relies on, so you must bump the clipboard module to a release that implements the updated RN 0.82 interfaces before the RN upgrade can succeed.

What changes do you think we should make in order to solve the problem?

Upgrade Plan for @react-native-clipboard/clipboard

  1. Update dependency npm install @react-native-clipboard/clipboard@latest

    • Inspect package-lock.json to ensure only this package updated.
  2. Rebuild native code

    • iOS: cd ios && pod install && cd ..
    • Android: clean Gradle caches (cd android && ./gradlew clean && cd .. or npm run android after cleaning)
    • This refreshes the native module bindings aligned with RN 0.82.
  3. Audit usage

    • Search for imports (search for "@react-native-clipboard/clipboard").
    • The API surface (Clipboard.getString, setString, hasString) might have new async behavior or TypeScript typings. Update any deprecated calls.
    • If you shimmed clipboard on web/desktop, confirm the module still exports default compat wrappers (some versions drop the default export in favor of named exports).
  4. Verify build configs

    • Ensure the module is autolinked; remove old manual linking instructions (if any).
    • On Android, confirm android/app/src/main/java/.../MainApplication.java doesn’t manually register the clipboard package.
  5. Testing

    • Run Metro with cache reset: npm start -- --reset-cache.
    • Run automated tests (Jest should pass; if TypeScript typing changed, run npm run typecheck).
    • Manual QA: copy/paste actions across platforms (chat composer, expense descriptions, attachments).
    • On iOS, verify “copy” actions still show the system toast; on Android, ensure clipboard listeners still work in background/foreground.
  6. Monitor

    • Build QA/TestFlight to ensure no runtime errors
    • Watch for warnings about missing android.permission.READ_CLIPBOARD_IN_BACKGROUND on newer Android

aqilusman45 avatar Nov 21 '25 10:11 aqilusman45

⚠️ @TaduJR Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

github-actions[bot] avatar Nov 22 '25 08:11 github-actions[bot]

I believe we can go with first proposal, by @AQIB-NAWAB. Thank you.

🎀 👀 🎀 C+ reviewed

brunovjk avatar Nov 26 '25 20:11 brunovjk

Triggered auto assignment to @mollfpr, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Nov 26 '25 20:11 melvin-bot[bot]

Update: PR still undes review

brunovjk avatar Dec 02 '25 21:12 brunovjk

This issue has not been updated in over 15 days. @mollfpr, @brunovjk, @AQIB-NAWAB, @lydiabarclay eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

melvin-bot[bot] avatar Dec 24 '25 00:12 melvin-bot[bot]

Hi @AQIB-NAWAB! Thanks for your work on this so far.

Since it’s been about three weeks and the changes are still not ready, we’re going to look for another contributor to help finish this issue so we can move it forward.

Thanks for your understanding!

mollfpr avatar Dec 24 '25 04:12 mollfpr

Posted https://expensify.slack.com/archives/C01GTK53T8Q/p1766550806335509 to look for contributor with RN package upgrade experience.

mollfpr avatar Dec 24 '25 04:12 mollfpr

🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

marufsharifi avatar Dec 24 '25 04:12 marufsharifi

⚠️ @marufsharifi Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

github-actions[bot] avatar Dec 24 '25 04:12 github-actions[bot]

@mollfpr, since the first proposal was accepted, I’ll continue working on the PR. However, my proposal post appears to have been removed by ProposalPolice.

marufsharifi avatar Dec 24 '25 05:12 marufsharifi

@mollfpr I did a quick check on this package. We’re currently using version 1.15.0, while the latest release is v1.16.3. I reviewed all updates since our current version (https://github.com/react-native-clipboard/clipboard/releases) and didn’t find any breaking or incompatible changes. Based on this, we should be able to safely upgrade the library in our app and run the tests again. Given that, I can help to raise a quick PR now to upgrade this package

cretadn22 avatar Dec 24 '25 06:12 cretadn22

Thank you both! Since this issue has been open for few weeks, we want this to get done quickly so it won't block the RN upgrade. We're looking experience contributor and availibility for this avoiding another delay.

@brunovjk Do you agree going with @cretadn22?

mollfpr avatar Dec 24 '25 06:12 mollfpr

We're looking experience contributor and availibility for this avoiding another delay.

I've taken note of this If I work on the PR

cretadn22 avatar Dec 24 '25 06:12 cretadn22

@brunovjk I'm also available to take this one since I worked on similar upgradation in past on another project, and will complete this on priority since we're already lagging here. Let me know what you think.

samranahm avatar Dec 24 '25 08:12 samranahm

I am also available. Since this also requires updating Podfile.lock in Mobile-Expensify repo, it's quicker to grant this job to C+.

situchan avatar Dec 24 '25 09:12 situchan

@mollfpr Yes, agreed. I bumped @react-native-clipboard/clipboard from 1.15.0 to 1.16.3 locally and everything looks good (no breaking changes noted). I’m fine with @cretadn22 taking this and raising the PR. Also +1 to @situchan’s point: as we need a Mobile-Expensify Podfile.lock update, C+ might be faster. What do you think? Thank you.

brunovjk avatar Dec 24 '25 14:12 brunovjk

Good point, @situchan!

To keep things fair, I’ll assign @samranahm to upgrade the package in the App repo, since their proposal is next in the queue. I’ll also assign @situchan to handle the Mobile-Expensify upgrade.

Compensation will be $125 for each task.

@samranahm @situchan — does this sound good?

mollfpr avatar Dec 24 '25 14:12 mollfpr

Sounds good to me

situchan avatar Dec 24 '25 14:12 situchan

Sound good.

samranahm avatar Dec 24 '25 14:12 samranahm

@samranahm @situchan Assigning both of you ❤️

mollfpr avatar Dec 25 '25 02:12 mollfpr

App: #78461 MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13813

cc: @brunovjk @mollfpr

samranahm avatar Dec 25 '25 15:12 samranahm

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Dec 30 '25 15:12 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.2.88-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/78461

If no regressions arise, payment will be issued on 2026-01-06. :confetti_ball:

For reference, here are some details about the assignees on this issue:

  • @brunovjk requires payment through NewDot Manual Requests
  • @situchan requires payment (Needs manual offer from BZ)
  • @samranahm requires payment (Needs manual offer from BZ)

melvin-bot[bot] avatar Dec 30 '25 15:12 melvin-bot[bot]

@brunovjk / @situchan @lydiabarclay The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

melvin-bot[bot] avatar Dec 30 '25 15:12 melvin-bot[bot]