Page MenuHomePhabricator

[native] Prevent simulators from attempting to open the barcode scanner
ClosedPublic

Authored by rohan on Aug 14 2023, 8:50 AM.
Tags
None
Referenced Files
F3599295: D8806.id30042.diff
Tue, Dec 31, 2:49 AM
F3599294: D8806.id29923.diff
Tue, Dec 31, 2:49 AM
F3599293: D8806.id29864.diff
Tue, Dec 31, 2:49 AM
F3599267: D8806.id.diff
Tue, Dec 31, 2:48 AM
F3599253: D8806.diff
Tue, Dec 31, 2:41 AM
Unknown Object (File)
Wed, Dec 25, 8:09 AM
Unknown Object (File)
Nov 17 2024, 10:44 AM
Unknown Object (File)
Nov 17 2024, 7:37 AM
Subscribers

Details

Summary

Launching the barcode scanner on a simulator crashes the entire app (this is because it is not a compatible platform.

We should prevent this from being accessed in the simulator.

Addresses ENG-4647

Depends on D8805

Test Plan

Confirmed that the scanner no longer is launched when on a simulator.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan edited the test plan for this revision. (Show Details)
rohan retitled this revision from [native] Prevent emulators from attempting to open the barcode scanner to [native] Prevent simulators from attempting to open the barcode scanner.
rohan requested review of this revision.Aug 14 2023, 9:07 AM
This revision is now accepted and ready to land.Aug 14 2023, 9:16 AM
native/profile/linked-devices-header-right-button.react.js
27 ↗(On Diff #29864)

The whole navigation object doesn't need to be here. That object changes rather often; in contrast, the simple function navigate changes rarely. It would be much better to only pass in the navigate function

native/utils/url-utils.js
81 ↗(On Diff #29864)

Now that we're exporting this, I think it might be helpful to rename it to deviceIsEmulator... dev feels ambiguous (could refer to "dev mode")