Frappe JS Caching Issues

Is the amazing Frappe team aware of the issues with ERP Next and its javvascript caching? The main issues that I’m referring to are caused by what I believe to be too much caching on certain parts of the system. For example, on the document Lists, if I go to the list of Leads (in CRM) and customize that list to show the lead status in the list… everything works great at first, when I go to the Leads list it shows my column along with the Status filters on the left column sidebar. However, If i then go back to CRM and click on Customer to go to the Customer list, everything is still fine because the customer list has not been loaded before and so no cache is loaded and that list loads fine…(no status column)… however, if I then go back to the Leads list once again, this time it loads the list really quickly (JS is fully cached), however the Status filter is not on the left sidebar… this happens every single time with any document type… the last time a document type list is cached (because it is visited for the first time since the last cache refresh), then all other lists that are cached seem to keep some of the properties of that last cached lists, until you land on the next document list that hasn’t been cached and then it will cache those settings and display those settings on all other cached lists, and so forth.

There are also other issues with caching similar to this around the system but this seems to be the most pressing one… the caching of the list sidebars across the different lists… the list sidebars are actually very different for each document type, depending on the fields it has,.and so the information shows wrong unless you Refresh the system screen… I believe the sidebar code needs to be un-cached from the list pages so that it loads the proper information across the different lists, unless I am misunderstanding this whole thing and something else is causing the issue…

Is frappe aware of these issues and if so are there plans on fixing it? Thank you for your AWESOME work.

Hi,

Thanks for reporting this. We will fix :slight_smile:

This caching issue also creates errors in the system… for example regarding the Status column being displayed in my leads list… when I go to the lead list, all is good, but then when I go to another list, if the doctype of that list does not have a status field at all, then the error “Field status is not selectable.”… shows up upon loading for example, the Customer list… I believe this is because it is trying to pull up the status filter list in the sidebar and cannot because status doesn’t exist for a customer doctype.

Sorry I hadn’t seen your reply there. Thanks.

Hi David,

Are you hosting erpnext by yourself? If yes, we just pushed a fix :slight_smile: It
should solve this problem.

Will release this fix on cloud in sometime.

Thanks for your detailed description. It was easy to reproduce the problem
after going through it.

Cheers,
Anand.

I am… I will pull right now and report back. That was quick, thanks!

Was it released on Git? I don’t see the change… I did the bench update but still see the issue. I also see the last commit wasn’t that recently.

It was pushed on the develop branch

Perfect, works great, thank you! I see you’re still caching the sidebar but now its by doctype which is great.

Will this be released on the 5.0 branch soon? I don’t have my production environment on the development branch.

I only ask because it’s been 16 days since that branch has been updated, usually it’s updated once a week or so.

We will be releasing it to master once it becomes more stable.

Hi,

Thank you for the sidebar fix. Although that issue is indeed fixed with the sidebar, the other issue I mentioned about the error showing up on the list was not fixed by this. If I go to the Lead list which shows the status column and then I go to any list that doesn’t contain a status field (like customer or newsletter), it shows me the error in a lightbox popup “Field status is not selectable.”… until that list is cached, once the list is cached it no longer shows the error but the first time you pull it up it always does.

In addition to that error, the sidebar is also keeping cache in the actual forms for the different doctypes… for example, if I go to a lead’s screen (click inside a lead), and that lead has an attachment or is assigned to someone on the left-hand side, if I then go to any other document form like a customer’s screen, it will keep the same sidebar as the lead was showing and not refresh it. Please get this cache issue fixed as well. Thank you.

Sorry I actually see that this error is caused by something in my custom app… I will fix this one myself. The other issue below still applies though as that is not related to anything I have done.

@ivg Thanks for your kind words. The left sidebar does not refresh if there is a js error in loading a particular list / form. If you come across such instance, please share the trace from your js console.

Hi guys.

Thanks for giving such detailed steps. I was able to fix it for now, though
the caching benefits are lost.

If you have it on your own servers, can you update and check?

Thanks,
Anand.