Assigned
Status Update
Comments
va...@google.com <va...@google.com>
nr...@google.com <nr...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 822b94312ab0e71054dcf8c007d4d8b6ba61db98
Author: Clara Fok <clarafok@google.com>
Date: Wed Dec 06 16:09:13 2023
Refactor PagingDataDiffer PageEvent processing
Streamline the process in preparation for upcoming refactors
Test: ANDROIDX_PROJECTS=INFRAROGUE ./gradlew paging:paging-common:allTest
Bug: 315214786
Change-Id: I809a5197633e9d7167388160509bec00566d7417
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PagePresenter.kt
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PagingDataDiffer.kt
https://android-review.googlesource.com/2871509
Branch: androidx-main
commit 822b94312ab0e71054dcf8c007d4d8b6ba61db98
Author: Clara Fok <clarafok@google.com>
Date: Wed Dec 06 16:09:13 2023
Refactor PagingDataDiffer PageEvent processing
Streamline the process in preparation for upcoming refactors
Test: ANDROIDX_PROJECTS=INFRAROGUE ./gradlew paging:paging-common:allTest
Bug: 315214786
Change-Id: I809a5197633e9d7167388160509bec00566d7417
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PagePresenter.kt
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PagingDataDiffer.kt
nr...@google.com <nr...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit fb741839c9be2e2a0a9e023bbba3c0cbac3c9ebb
Author: Clara Fok <clarafok@google.com>
Date: Wed Dec 06 16:22:46 2023
Rename PagePresenter to PageStore
PageStore will be refactored to only process and store loaded data.
Test: ANDROIDX_PROJECTS=INFRAROGUE ./gradlew paging:paging-common:allTest
Bug: 315214786
Change-Id: Ic3502d2a541e02355d65cc5154025a0301a50ec5
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PageStore.kt
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PagingDataDiffer.kt
M paging/paging-common/src/commonTest/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt
M paging/paging-common/src/commonTest/kotlin/androidx/paging/PageStoreTest.kt
M paging/paging-common/src/commonTest/kotlin/androidx/paging/ProcessPageEventCallbackCapture.kt
https://android-review.googlesource.com/2871510
Branch: androidx-main
commit fb741839c9be2e2a0a9e023bbba3c0cbac3c9ebb
Author: Clara Fok <clarafok@google.com>
Date: Wed Dec 06 16:22:46 2023
Rename PagePresenter to PageStore
PageStore will be refactored to only process and store loaded data.
Test: ANDROIDX_PROJECTS=INFRAROGUE ./gradlew paging:paging-common:allTest
Bug: 315214786
Change-Id: Ic3502d2a541e02355d65cc5154025a0301a50ec5
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PageStore.kt
M paging/paging-common/src/commonMain/kotlin/androidx/paging/PagingDataDiffer.kt
M paging/paging-common/src/commonTest/kotlin/androidx/paging/PageFetcherSnapshotStateTest.kt
M paging/paging-common/src/commonTest/kotlin/androidx/paging/PageStoreTest.kt
M paging/paging-common/src/commonTest/kotlin/androidx/paging/ProcessPageEventCallbackCapture.kt
Description
When sending a request to a prediction endpoint it will exceed the size limit of 1.5 MB even though the request body is below that limit.
Problem you have encountered:
We have created a batcher which groups instances for the predictions so that the limit is honored. It uses "compact" JSON serialization (no newlines, no indents). We then string-join the separate "instance" JSON strings to form a request body.
We are sending a request which we know is below limit in bytesize (1572847 bytes). This is below 1.5MB (1572864 bytes). However, we still receive an error from the endpoint:
What you expected to happen:
We expected the request body to be accepted. It is valid JSON and it is below the bytesize limit.
The suspicion we have is that the API gateway for the endpoint parses JSON and then re-emits it, and then checks for bytesize. This is opaque and makes it hard for a developer to adhere to the limit in the first place. The bytesize should instead be checked against the actual HTTP request body "as received".
Steps to reproduce:
Generate a JSON request body using "compact" JSON serialization (no newlines, no indents), which would be just below the bytesize limit. Send it to the endpoint. You will likely observe the same error.
We have implemented a workaround by having to generate "pretty" JSON serialization when batching. In practice this leads to a substantial increase of JSON serializations we need to do, because indented/"pretty" serialization is hard to precompute for bytesize. This leads to some waste of compute.