Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-531

Object creating takes very long in ios (react native)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None

      recently updated from 3.6.4 to 5.0.3.
      object creating takes much longer that it used to on both simulators and iphones + blocks ui.

      Expected Results

      quick creating as it used to be

      Actual Results

      average object creation takes about 400ms and blocks the ui

      Code Sample

      postRealm.write(() => {
      	if (cleanAll) {
      		let allPosts = postRealm.objects('post24').filtered('projectId = "' + projectId + '"');
      		let allLastUpdateTS = postRealm.objects('lastUpdateTS').filtered('projectId = "' + projectId + '" AND type = "post"');
      		postRealm.delete(allLastUpdateTS);
      		postRealm.delete(allPosts); 
      	}
      	
      	preparedPostArray.forEach(post => {
      		if (post && post.id) 
      			postRealm.create('post24', post, true);
      		else {
      			console.warn('post missing ID'); 
      		}
      	});
      
      	if (projectId && ignoreTimestamp)
      		postRealm.create('lastUpdateTS', { id: projectId + '_post', lastUpdateTS: newLastUpdateTS, projectId, type: 'post' }, true)
      });	
      

      Versions

      • Realm JS SDK Version: 5.0.3
      • React Native: 0.61.5
      • Client OS & Version: macOs Catalina 10.15.4

            Assignee:
            lubo.blagoev@mongodb.com Lubo Blagoev
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: