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";
33const pako = require ( "pako" ) ;
44
55export class PreviewSdkService implements IPreviewSdkService {
6+ private static MAX_FILES_UPLOAD_BYTE_LENGTH = 30000 ;
67 private messagingService : MessagingService = null ;
78 private instanceId : string = null ;
89 public connectedDevices : Device [ ] = [ ] ;
@@ -75,6 +76,11 @@ export class PreviewSdkService implements IPreviewSdkService {
7576 onSendingChange : ( sending : boolean ) => ( { } ) ,
7677 onBiggerFilesUpload : async ( filesContent , callback ) => {
7778 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+
7884 const playgroundUploadResponse = await this . $httpClient . httpRequest ( {
7985 url : this . $config . UPLOAD_PLAYGROUND_FILES_ENDPOINT ,
8086 method : "POST" ,
You can’t perform that action at this time.
0 commit comments