Skip to content

[DataStore] Inconsistent support for min/max integer values #850

Open
@Jordan-Nelson

Description

@Jordan-Nelson

Describe the bug
Datastore has inconsistent support for the max/min values that can be stored for for integer types. The following mix/max values are supported in each platform.

iOS Max: 2^53 (larger values can be saved, but the incorrect value will be returned when queried)
iOS Min: -(2^63) (min 64 bit int)
Android Max: 2^31 - 1 (max 32 bit int)
Android Min: -(2^31) (min 32 bit int)

To Reproduce
Steps to reproduce the behavior:

  1. Create a sample app with a model that has an int value
  2. Save a model that has a value larger/smaller than the values listed above
  3. Query the model and compare it to the saved value
  4. The queries will either fail, or the value will not save correctly

Expected behavior

  • Both platforms should support the same min/max values
  • max/min 64 bit 32 bit integers should be supported
  • attempting to save a value small/larger than the min/max value should fail with a clear exception

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):
[x] Android
[x] iOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working; the issue has reproducible steps and has been reproduceddatastoreIssues related to the DataStore CategoryiOSIssues specific to the iOS Platformplatform-discrepancyIssues that result in inconsistent behavior between support platformsrequires-ios-fixThis issue is the result of an underlying Amplify iOS issue that needs to be fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions