Local Aggregates limitations

Hi,

After upgrade to 11.9.0 we have some issues on compilation step on some mobile modules publish. It was narrowed down that issue was in specific aggregates that had 10 joins and 3 group by's... Not that it doesn't need refactor but I was curious if there are any limitations on local aggregates? Like not more that 5 joins... Or not more that 10 "or" conditions in Filters... 

Hello Nick.

The version is 11.9? General Availability is 11.8 so I don't expect 11.9 do be fully functional yet.

Regarding your particular situation, local aggregates on mobile should be plain and simple. The most complex I have right now is I think 3 joins, but the full database is 100 records so it doesn't justify optimizing.

You already said that refactor is needed. Maybe SS should say it too. If there is such a limit without warnings, why don't you report it from SS or create an idea for that?



Hi Nick,

I worked on a mobile project, with a bit of a different use case, the application was actually used in the browser not on a mobile device (this was 2 years before Reactive Web developed was introduced). I cannot recall the exact number of joins and group by's but we had many complex local storage aggregates, with many entities and group by's. 

We never got into complication issues.

But having said that, you should try to keep your aggregates as simple as possible on local storage, if not to avoid compilation errors,just for the sake of performance and code maintainability.

Regards,

Daniel

Nuno Reis yes we have Version 11.8.0 - sorry for confusion... 

after refactoring of the aggregate module successfully published but it takes now 3-4 minutes each time.... nevertheless the app now timeouts in 30 sec on login because of this call to **UI.aggregates.IDB.js . I don't see this call in previous version of the app.



Solution

Hi Mykola,

This is a known issue with larger aggregates introduced with the recent support for PWAs. It was was already fixed and it's going be released in a future version (probably 11.8.2), but in the meantime there is a workaround that involves using the FactoryConfiguration forge component and disabling the "IndexedDB for Local Storage data on PWAs/Browsers" setting. Let me know if you need help with this.

Thanks,
Tiago Simões

Solution

Hi Tiago,

Thanks for the update and explanation:) Just to clarify - this fix will disable IndexedDB on mobile app or also will fix compiler timeout?

Hi Mycola,

It should fix both of those issues.

Cheers,
Tiago Simões

Thank you Tiago :) That is a great news.
Meanwhile I don't see "IndexedDB for Local Storage data on PWAs/Browsers" setting.. Is it something should be created manually on eSpace specific configuration?

Hi Mykola,

It should be on "Platform Configurations" tab, "Compiler" section. If you're not seeing it try updating Factory Configuration from Forge.

Hi Carlos,

Thank you - after update it appeared. We've disabled it but application still calling ***/scripts/***MobileUI.aggregates.IDB.js and timeouts. 

Are there any additional action or prerequisites that should be done to disable it?

Mykola (Nick) Tkachenko wrote:

Hi Carlos,

Thank you - after update it appeared. We've disabled it but application still calling ***/scripts/***MobileUI.aggregates.IDB.js and timeouts. 

Are there any additional action or prerequisites that should be done to disable it?

Hum... That's weird... Have you republished the app and its producers?


I've probably missed one of the producers(( I've republished all and now it is working again! :) Thank you !

Tiago Simões is there any expected date fot 11.8.2 release?

HI Tiago Simões, Is the workaround fix to use the deprecated WebSQL instead of the more modern IndexDB temporary?  Will the fix implemented in the new Platform version allow us to switch back to IndexDB - reenabling the setting in Factory Configuration?

Justin Santiago wrote:

HI Tiago Simões, Is the workaround fix to use the deprecated WebSQL instead of the more modern IndexDB temporary?  Will the fix implemented in the new Platform version allow us to switch back to IndexDB - reenabling the setting in Factory Configuration?

Hi Justin,

Yes, the fix to use WebSQL instead of indexedDB is temporary. Once you upgrade to 11.8.2 you can re-enable the use of indexedDB in Factory Configuration.

Also, bear in mind that if you app does not use many aggregates and they are simple (< 5 entities, Only With joins) you can use indexedDB. The current problem with indexedDB is that the generated code is too verbose and increases rapidly with the complexity of the aggregate.