Skip to content

Decoding error relevant to UInt16 used in BVConversationsQueryMetaData #80

Description

@mustang11

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions