Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Fix isPhysicalDevice check in web environment #296

Closed
Tracked by #298
ethanwlee opened this issue Sep 6, 2024 · 5 comments · Fixed by #307
Closed
Tracked by #298

Fix isPhysicalDevice check in web environment #296

ethanwlee opened this issue Sep 6, 2024 · 5 comments · Fixed by #307

Comments

@ethanwlee
Copy link
Contributor

  • when running didpay on web (by selecting "Chrome - web" as your device in VSCode), an unsupported operation error is thrown when running the isPhysicalDevice() check
  • originally, this check was used to see if the user was on a real, physical device so the app knows if it is possible to use the camera (i.e. to scan qr codes)
  • since didpay on web will not support qr code scanning, add a check to the isPhysicalDevice() method in DeviceInfoService to prevent the below error
DartError: Unsupported operation: Platform._operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart 244:5                   _operatingSystem
dart-sdk/lib/io/platform_impl.dart 56:40                                          get operatingSystem
dart-sdk/lib/io/platform.dart 83:44                                               get operatingSystem
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 1293:8  get
dart-sdk/lib/io/platform.dart 161:46                                              get isIOS
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 1293:8  get
packages/didpay/features/device/device_info_service.dart 11:53                    isPhysicalDevice
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5                _async
packages/didpay/features/device/device_info_service.dart 11:32                    isPhysicalDevice
packages/didpay/features/dap/dap_qr_tile.dart 28:30                               <fn>
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54                runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5                _async
packages/didpay/features/dap/dap_qr_tile.dart 27:11                               <fn>
dart-sdk/lib/async/future.dart 422:39                                             <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:11           internalCallback
@mohitrajsinha
Copy link
Contributor

HI @ethan-tbd . Please assign me this issue.

@mohitrajsinha
Copy link
Contributor

Hi @ethan-tbd ,
I tried running the app but got this issue DartError: Unsupported operation: Int64 accessor not supported by dart2js..
I think there is an issue with web5: ^0.3.0 package.
Can we fix this issue and run the app?
image

@ethanwlee
Copy link
Contributor Author

@mohitrajsinha fix has been made: #304

@mohitrajsinha
Copy link
Contributor

.take

Copy link

github-actions bot commented Oct 3, 2024

The issue you are trying to assign to yourself is already assigned.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants