amplify-swift icon indicating copy to clipboard operation
amplify-swift copied to clipboard

When saving data with integer out of range -(2^31) and 2^32-1, data cannot be correctly preserved

Open HuiSF opened this issue 3 years ago • 4 comments
trafficstars

Describe the bug

According to AppSync documentation, the scalar type Int range is between -(2^31) and 2^32-1.

As a developer I can save a value out of above described using DataStore, however, after data to be synced via AppSync, and query saved data, the value became incorrect.

Original issue: https://github.com/aws-amplify/amplify-flutter/issues/850

Steps To Reproduce

Steps to reproduce the behavior:
1. Create a schema with `Int` value
2. Save model with a `Int` value out of range -(2^31) and 2^32-1
3. Save model when API sync is enabled
4. Query the model
5. check the save int value

Expected behavior

iOS should align with AppSync and prevent the unexpected the issue on persisted data accuracy.

Amplify Framework Version

The latest

Amplify Categories

DataStore

Dependency manager

Swift PM

Swift version

5

CLI version

The latest

Xcode version

13.2.1

Relevant log output

No response

Is this a regression?

No

Regression additional context

No response

Device

iPhone 13 simulators

iOS Version

iOS 15

Specific to simulators

No response

Additional context

No response

HuiSF avatar Mar 10 '22 18:03 HuiSF

Thanks for reporting this. We likely need to add input validation to constrain Int values to the range supported by AppSync.

ameter avatar Mar 10 '22 18:03 ameter

Hi team, any update on this issue?

HuiSF avatar May 16 '22 17:05 HuiSF

Adding to the backlog as a P2. Please connect with PMs for priority.

undefobj avatar Jun 06 '22 18:06 undefobj

Our team is actively prioritizing and working on issues. We will provide an update on the issue as soon as we can.

harsh62 avatar Oct 03 '23 14:10 harsh62