App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-28] [$175] Migrate ShareActionHandlerModule to Nitro

Open roryabraham opened this issue 1 month ago β€’ 19 comments

ShareActionHandlerModule is a legacy module using the Old Arch compatibility layer (i.e: eagerly loaded on startup), with no compile-time type safety. This issue is a placeholder to migrate it to use a modern Nitro/Swift/Kotlin stack instead of legacy modules/Objective-C/Kotlin and to establish a compile-time type safety contract.

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @TaduJR

roryabraham avatar Oct 21 '26 05:10 roryabraham

@nabi-ebrahimi is going to work on this

roryabraham avatar Oct 21 '26 05:10 roryabraham

@roryabraham me here

nabi-ebrahimi avatar Oct 21 '26 05:10 nabi-ebrahimi

@roryabraham β€” to hire @nabi-ebrahimi on Upwork, add the External label so a job is created and the offer is sent automatically.

melvin-bot[bot] avatar Oct 21 '26 06:10 melvin-bot[bot]

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

melvin-bot[bot] avatar Oct 21 '26 06:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022112798897148465974

melvin-bot[bot] avatar Oct 21 '26 06:10 melvin-bot[bot]

Proposal

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

ShareActionHandlerModule (src/libs/ShareActionHandlerModule/index.ts and index.native.ts) is currently implemented as a legacy React Native bridge module (NativeModules.ShareActionHandlerModule) using the Old Architecture compatibility layer, which is eagerly initialized at startup and lacks compile-time type safety across TypeScript, Swift, and Kotlin. We need to migrate it to a modern react-native-nitro-modules (HybridObject) implementation.

What is the root cause of that problem?

ShareActionHandlerModule was written before the codebase adopted react-native-nitro-modules. Its iOS (ShareActionHandlerModule.h/.m) and Android (ShareActionHandlerModule.kt / ShareActionHandlerPackage.kt) implementations still extend RCTBridgeModule / ReactContextBaseJavaModule and are accessed via untyped NativeModules.ShareActionHandlerModule in src/libs/ShareActionHandlerModule/index.native.ts.

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

  1. Define the Nitro specification interface ShareActionHandler.nitro.ts (extending HybridObject<{ ios: 'swift', android: 'kotlin' }>) with processFiles(callback: (files: string) => void): void (or typed ShareTempFile[] return/callback contract matching ShareActionHandlerModule).
  2. Run nitrogen code generation to generate the C++/Swift/Kotlin Nitrogen bindings.
  3. Implement HybridShareActionHandler in Swift (ios/NewExpensify/HybridShareActionHandler.swift) and Kotlin (android/app/src/main/java/com/expensify/chat/HybridShareActionHandler.kt), migrating the file-reading logic from the legacy ShareActionHandlerModule classes and removing ShareActionHandlerPackage from eager package registration.
  4. Update src/libs/ShareActionHandlerModule/index.native.ts to instantiate the Nitro hybrid object via NitroModules.createHybridObject<ShareActionHandler>('ShareActionHandler') while keeping src/libs/ShareActionHandlerModule/index.ts as the no-op web fallback.

What alternative solutions did you explore? (Optional)

We considered migrating ShareActionHandlerModule to a TurboModule (RCTTurboModule), but the issue specifically standardizes on react-native-nitro-modules (Nitro / Swift / Kotlin) for direct JSI bindings without Objective-C++ glue code.

jeffrey-graham avatar Nov 07 '26 09:11 jeffrey-graham

πŸ“£ @jeffrey-graham! πŸ“£ Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

melvin-bot[bot] avatar Nov 07 '26 09:11 melvin-bot[bot]

I can take over

TaduJR avatar Nov 13 '26 19:11 TaduJR

πŸ“£ @TaduJR πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

melvin-bot[bot] avatar Nov 13 '26 21:11 melvin-bot[bot]

Thanks @TaduJR

roryabraham avatar Nov 13 '26 21:11 roryabraham

Since @TaduJR is assigned here I can safely transition out of this issue.

@TaduJR Please create both E/App and Mobile-Expensify PRs using Melvin. I am going to unassign myself.

shubham1206agra avatar Nov 14 '26 03:11 shubham1206agra

@TaduJR any estimate when you might be able to complete this?

roryabraham avatar Nov 16 '26 23:11 roryabraham

@roryabraham

Thanks for the bump!

ETA EOD/tomorrow to raise the new PR.

TaduJR avatar Nov 17 '26 04:11 TaduJR

@MelvinBot

Do you have access to raise a PR on Mobile-Expensify before giving you the diff?

TaduJR avatar Nov 18 '26 04:11 TaduJR

Noβ€”not with my current access. GitHub returns 404 Not Found for Expensify/Mobile-Expensify, so I can’t create a PR there. An internal engineer with repository access will need to handle that PR.


view run

MelvinBot avatar Nov 18 '26 05:11 MelvinBot

@TaduJR

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.51-1 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/107279

If no regressions arise, payment will be issued on 2026-11-28. :confetti_ball:

The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

melvin-bot[bot] avatar Nov 21 '26 01:11 melvin-bot[bot]

Not Overdue!

Working on follow-ups!

TaduJR avatar Nov 24 '26 07:11 TaduJR

What else do we have to complete here? Isn't this done and just awaiting payment now?

roryabraham avatar Nov 24 '26 20:11 roryabraham

@roryabraham

The follow-ups are a small App + Mobile-Expensify PR pair that I'm finishing:

  • Your async/await NAB on ShareRootPage https://github.com/Expensify/App/pull/107279#discussion_r4631966931
  • ikevin127's NAB: Android share previews ignore EXIF and video rotation https://github.com/Expensify/App/pull/107279#discussion_r4621781638

Also some three bugs I found during previous PR, and DRY. I can remove the bug fixes if you prefer dedicated issues. I just included then coz there fix was relatively not that complex.

TaduJR avatar Nov 26 '26 15:11 TaduJR