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

Decoding error relevant to UInt16 used in BVConversationsQueryMetaData #80

Open
mustang11 opened this issue Feb 28, 2024 · 0 comments
Open

Comments

@mustang11
Copy link

mustang11 commented Feb 28, 2024

The Problem

For any query that returning a large number of results, typically BVReview, when total results value is larger than 65536, the query would fail due to an unhandled decoding error.

Steps to Reproduce

Query any product review data that has more than 65,536 records.

Expected Behavior

The query should succeed when total results is larger than total 65536

Environment

  • Specific BVSwift submodule that exhibits the issue:
    Conversations
  • BVSwift version (or git revision) that exhibits the issue:
    master
  • Last BVSwift version that did not exhibit the issue (if applicable):
    None
  • iOS version that exhibits the issue:
    Any version
  • Last iOS version that exhibits the issue (if applicable):
  • Xcode version:
    15.2
  • iOS Mobile SDK version build for under test:
    1.12.0
  • Real device or simulator:
    Both

Details

UInt16 is used in the following properties of protocol BVConversationsQueryMetaData

  • offset
  • totalResults

Once the value from JSON response is larger than 65,536 - the upper bound of UInt16, there would be an integer overflow error raising from Decoder.

UInt should be used instead to prevent this issue.

Link to BVSwift Logs

N/A

Code To Reproduce Issue [ Very Good To Have ]

N/A

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

No branches or pull requests

1 participant