amplify-swift
amplify-swift copied to clipboard
When saving data with integer out of range -(2^31) and 2^32-1, data cannot be correctly preserved
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
Thanks for reporting this. We likely need to add input validation to constrain Int values to the range supported by AppSync.
Hi team, any update on this issue?
Adding to the backlog as a P2. Please connect with PMs for priority.
Our team is actively prioritizing and working on issues. We will provide an update on the issue as soon as we can.