feat: compress shareLink data when uploading to json server (#4225)
This commit is contained in:
@ -234,7 +234,19 @@ const splitBuffers = (concatenatedBuffer: Uint8Array) => {
|
||||
|
||||
let cursor = 0;
|
||||
|
||||
// first chunk is the version (ignored for now)
|
||||
// first chunk is the version
|
||||
const version = dataView(
|
||||
concatenatedBuffer,
|
||||
NEXT_CHUNK_SIZE_DATAVIEW_BYTES,
|
||||
cursor,
|
||||
);
|
||||
// If version is outside of the supported versions, throw an error.
|
||||
// This usually means the buffer wasn't encoded using this API, so we'd only
|
||||
// waste compute.
|
||||
if (version > CONCAT_BUFFERS_VERSION) {
|
||||
throw new Error(`invalid version ${version}`);
|
||||
}
|
||||
|
||||
cursor += VERSION_DATAVIEW_BYTES;
|
||||
|
||||
while (true) {
|
||||
|
Reference in New Issue
Block a user