File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
lib/services/livesync/playground Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { PubnubKeys } from "./preview-app-constants";
3
3
const pako = require ( "pako" ) ;
4
4
5
5
export class PreviewSdkService implements IPreviewSdkService {
6
+ private static MAX_FILES_UPLOAD_BYTE_LENGTH = 30000 ;
6
7
private messagingService : MessagingService = null ;
7
8
private instanceId : string = null ;
8
9
public connectedDevices : Device [ ] = [ ] ;
@@ -75,6 +76,11 @@ export class PreviewSdkService implements IPreviewSdkService {
75
76
onSendingChange : ( sending : boolean ) => ( { } ) ,
76
77
onBiggerFilesUpload : async ( filesContent , callback ) => {
77
78
const gzippedContent = Buffer . from ( pako . gzip ( filesContent ) ) ;
79
+ const byteLength = gzippedContent . byteLength ;
80
+ if ( byteLength > PreviewSdkService . MAX_FILES_UPLOAD_BYTE_LENGTH ) {
81
+ this . $logger . warn ( "The files to upload exceed the maximum allowed size of 15MB. Your app might not work as expected." ) ;
82
+ }
83
+
78
84
const playgroundUploadResponse = await this . $httpClient . httpRequest ( {
79
85
url : this . $config . UPLOAD_PLAYGROUND_FILES_ENDPOINT ,
80
86
method : "POST" ,
You can’t perform that action at this time.
0 commit comments