Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid numeric inputs for props to avoid crash #115

Conversation

roni-castro-shipt
Copy link
Collaborator

@roni-castro-shipt roni-castro-shipt commented Dec 26, 2024

WIP - It depends on another PR code

Description

Currently, if NaN is passed for numeric props, the app crashes.

Solution

Ensure that all numeric properties are parsed before use. If the parsed value results in NaN, revert to the default value for that property and issue a warning that an invalid value was provided and its value was changed to the default one. If the value is valid, maintain the existing behavior and don't show warning

Screenshots

Android

Before After
before_android_fillValue_NaN.mp4
after_android_fillValue_NaN.mp4

iOS

Before After
before_android_fillValue_NaN.mp4
after_ios_fillValue_NaN.mp4

No warnings if props if some props are not passed and are numeric

Warnings shown only once

warnings_for_invalid_props_shown_once.mp4

@roni-castro-shipt roni-castro-shipt force-pushed the support/handle-invalid-numeric-inputs branch from 70987ad to 6dbc63e Compare December 26, 2024 15:26
@roni-castro-shipt roni-castro-shipt force-pushed the support/handle-invalid-numeric-inputs branch from 6dbc63e to e1c5b80 Compare January 8, 2025 15:30
@roni-castro-shipt roni-castro-shipt force-pushed the support/handle-invalid-numeric-inputs branch from e1c5b80 to 13927ac Compare January 8, 2025 19:18
@roni-castro-shipt roni-castro-shipt force-pushed the support/handle-invalid-numeric-inputs branch from b38429b to 057a3c3 Compare January 28, 2025 23:39
@roni-castro-shipt roni-castro-shipt force-pushed the support/handle-invalid-numeric-inputs branch from 057a3c3 to 3c68380 Compare January 29, 2025 15:56
@roni-castro-shipt roni-castro-shipt force-pushed the support/handle-invalid-numeric-inputs branch from 0c0d608 to 6143470 Compare January 30, 2025 18:59
@roni-castro-shipt roni-castro-shipt changed the base branch from development to support/Roni/CU-86b39mr3a/handle-invalid-numeric-inputs January 31, 2025 20:24
@roni-castro-shipt roni-castro-shipt merged commit 9a2eb96 into shipt:support/Roni/CU-86b39mr3a/handle-invalid-numeric-inputs Jan 31, 2025
@roni-castro-shipt roni-castro-shipt deleted the support/handle-invalid-numeric-inputs branch January 31, 2025 20:39
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.

1 participant