Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when working with large size data #247

Open
ngwaitat opened this issue Mar 13, 2019 · 0 comments
Open

Exception when working with large size data #247

ngwaitat opened this issue Mar 13, 2019 · 0 comments

Comments

@ngwaitat
Copy link

ngwaitat commented Mar 13, 2019

Hi, this is the exception I get when I try to write about 1MB size of data to the collaboration object:

Uncaught Error: Class$S21
at Lob.bg [as vb] (swellrt_beta-0.js:5348)
at Lob.fg [as yb] (swellrt_beta-0.js:5348)
at Lob.ig (swellrt_beta-0.js:1847)
at new Lob (swellrt_beta-0.js:1704)
at Sib (swellrt_beta-0.js:4347)
at kjb (swellrt_beta-0.js:3953)
at SGb (swellrt_beta-0.js:828)
at KFb (swellrt_beta-0.js:2531)
at RFb (swellrt_beta-0.js:4135)
at QFb (swellrt_beta-0.js:2714)
at wHb.ZHb [as put] (swellrt_beta-0.js:5352)

Here is the code that I used to open a file and generate data to it:

swellrt.onReady(service => {
    realtimeServiceReady(service);
});

var realtimeServiceReady = function(service) {
    var anonymousLoginInfo = createAnonymousLoginInfo();

    service.login(anonymousLoginInfo)
        .then(profile => {
            anonymousLoggedInToServer(service);
        })
        .catch(error => {
        });        
};

var createAnonymousLoginInfo = function() {
    return {
        id: swellrt.Constants.ANONYMOUS_USER_ID,
        password: ''
    };
};

var anonymousLoggedInToServer = function(service) {
    console.log('Anonymous logged in to server');
    
    window['openRtFile'] = function(fileId) {
        var fileInfo = createFileInfo(fileId);

        service.open(fileInfo)
            .then(file => {
                fileOpened(file);
            })
            .catch(error => {
            });
    };
};

var createFileInfo = function(fileId) {
    return {
        id: fileId
    };
};

var fileOpened = function(file) {
    console.log('File opened');
    
    window['genRtData'] = function(count) {
        for (var i = 0; i < count; i++) {
            var id = String(i + 1);
            var data = 'Lorem ipsum dolor sit amet, consectetur adipiscing ' + 
                       'elit, sed do eiusmod tempor incididunt ut labore et ' + 
                       'dolore magna aliqua. Ut enim ad minim veniam, quis ' + 
                       'nostrud exercitation ullamco laboris nisi ut aliquip ' + 
                       'ex ea commodo consequat. Duis aute irure dolor in ' + 
                       'reprehenderit in voluptate velit esse cillum dolore ' + 
                       'eu fugiat nulla pariatur. Excepteur sint occaecat ' + 
                       'cupidatat non proident, sunt in culpa qui officia ' + 
                       'deserunt mollit anim id est laborum.';

            file.put(id, data);

            console.log('Done gen data: ' + (i + 1) + ' of ' + count);
        }
    }
};

I test when I gen data of count of around 2500 then it will fail at the above exception. I've also tried to use fewer properties but more data for each property, and eventually will hit the same problem. Is there any configuration I can change to avoid this exception from happening? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant