BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Objects reloading all the time in administration #173

Open ascheider opened 2 weeks ago

ascheider commented 2 weeks ago

We have currently the issue with the random object reloading in the pimcore. I analyzed the issue, there is endpoint BlackbitDataDirector/import/has-element-changed which triggers all the time object reloading.

image

DD Version: 3.6.36 It annoys currently the editors, specially when they have opened a lot of objects. The DD is not even open. How can i disable this feature? Thanks for the advice!

BlackbitDevs commented 2 weeks ago

Please update. This has been fixed in 3.6.44.

ascheider commented 2 weeks ago

@BlackbitDevs Upgraded to the last version 3.6.48. Pimcore Version 11.2.4. Objects are still reloaded. For example i have 3 Objects open, i'm on the second one which i want to edit, the other 2 are reloaded all the time, no one is changing this objects. Maybe there is still bug somewhere.

BlackbitDevs commented 2 weeks ago

This can actually not be. Please clear browser cache and send screenshot of network panel again.

ascheider commented 2 weeks ago

@BlackbitDevs 1.) Load the pimcore Bildschirmfoto 2024-07-10 um 13 03 36 2.) After some requests, the objects are reloaded and rearranged Bildschirmfoto 2024-07-10 um 13 04 15 3.) DD Version, cleared Cache and also tried to symlink the assets again: assets:install public --symlink --relative Bildschirmfoto 2024-07-10 um 13 04 39

BlackbitDevs commented 2 weeks ago

Ok, this is the latest DD version, so all done correctly.

Are the objects being saved in the background so that the modification date really changes? This feature is about reloading objects which have been changed by other users or imports so that you always see the latest data. Changed tabs and the currently focussed tab do not get reloaded.

ascheider commented 2 weeks ago

@BlackbitDevs I also have another issue after update of DD. If i click on Dataport, the panel script is loaded from another url, then defined in Bundle file: '/bundles/blackbitdatadirector/js/components/DataportPanel.js', image Any idea why?

BlackbitDevs commented 2 weeks ago

If i click on Dataport, the panel script is loaded from another url, then defined in Bundle file: '/bundles/blackbitdatadirector/js/components/DataportPanel.js',

??? This is not from DD. The JS files only get loaded when Pimcore backend boots up. This looks like the URL from ancient Pimcore 5 version. Can you search over your project for DataportPanel.js?

ascheider commented 2 weeks ago

@BlackbitDevs Okay weird, the request is executed if i click on the dataport no matter which one image

BlackbitDevs commented 2 weeks ago

Do you have the plugin blackbit/pim (predecessor of Data Director) still installed?

ascheider commented 2 weeks ago

@BlackbitDevs No, i have only this 2

image

BlackbitDevs commented 2 weeks ago

Have searched the source code again for /plugin and DataportPanel.js - and not found anything (except for /bundles/blackbitdatadirector/js/components/DataportPanel.js). I would say that this comes not from DD. Please search your project for DataportPanel.js.

And about the reloading tabs problem, could you please send an email / meeting appointment to jan.walther@blackbit.de so that I can take a look at this problem?

ascheider commented 2 weeks ago

@BlackbitDevs One more question, how is your PIMCORE_DEV_MODE env variable set? If its set to PIMCORE_DEV_MODE=true pimcore loads all the scripts with script tag image With this setting my DD works fine. If i set it to false PIMCORE_DEV_MODE=false pimcore mifies all the scripts and loads it from var/admin folder image Here my DD does not work with requested missing DataportPanel.js file. The minified file contains all the DD scripts image

BlackbitDevs commented 2 weeks ago

Have checked with PIMCORE_DEV_MODE=true and false. No problems.

You mean that the wrong JS file path comes from the variable name pimcore.plugin.Pim.DataportPanel? Have never seen this. Especially with PIMCORE_DEV_MODE=true it sound strange to me that a call to a single JS file gets done.

ascheider commented 2 weeks ago

@BlackbitDevs It was also my idea. Downgraded to 3.6.36 back and the problem is gone. No request is made anymore. Must be something between 3.6.36 and current which causes the problem with minified scripts.

Regarding reloading issue, i disabled it with small js-override.

// Disable reloading of the objects (function(checkForUpdate) { pimcore.plugin.Pim.plugin.prototype.checkForUpdate = function(elementId, elementType, modificationDate) { // overrride data director method, to prevent update check } }(pimcore.plugin.Pim.plugin.prototype.checkForUpdate));

I don't really like the feature, if you open like 50 objects, there are basically 50 request each 3 seconds, endpoint performs some SQL-Queries.

The newest version seems to send multiple id's in one request. The request is performed as GET request, so if payload grows it can reach limit, i think generally is POST request better here. Pimcore already had such problems with filters as GET request.

Thank you for your help!

BlackbitDevs commented 2 weeks ago

Downgraded to 3.6.36 back and the problem is gone. No request is made anymore. Must be something between 3.6.36 and current which causes the problem with minified scripts.

Have changed something. Could you try 3.6.x-dev if the problem with loading DataportPanel.js still exists there?

I don't really like the feature, if you open like 50 objects, there are basically 50 request each 3 seconds, endpoint performs some SQL-Queries.

No, this has been changed. It is only 1 request for all open tabs (but you have already written in your next sentence).

What don't you like exactly about this feature? Is it only that it currently does not work for you or do you think it is not useful at all? The problem is that users sometimes have a lot of tabs open and the data in them may have been changed in the meantime and this may lead to confusion. Of course, the order of tabs needs to stay the same when reloading. You said that the order changed, I will check this. But I am looking forward to your general feedback. Patching the JS to disable this feature is not the optimal solution, let's try to find a good solution for all users!

The request is performed as GET request, so if payload grows it can reach limit, i think generally is POST request better here. You are right, I change it to POST.

I can only reproduce the problem with continously reloading tabs when I set the modificationDate to a date in the future in the database. Can this be the case for your objects? Nevertheless I will fix this...

ascheider commented 2 weeks ago

@BlackbitDevs If i install the latest 3.6.x-dev the error is gone if i open up the dataport. Request for the DataportPanel is not sent anymore. So i guess it fixed.

BlackbitDevs commented 2 weeks ago

Perfect, thanks for checking!

Do you have any feedback on this?

What don't you like exactly about this feature? Is it only that it currently does not work for you or do you think it is not useful at all? The problem is that users sometimes have a lot of tabs open and the data in them may have been changed in the meantime and this may lead to confusion. Of course, the order of tabs needs to stay the same when reloading. You said that the order changed, I will check this. But I am looking forward to your general feedback. Patching the JS to disable this feature is not the optimal solution, let's try to find a good solution for all users!

ascheider commented 1 week ago

@BlackbitDevs I don't like it exactly because of the tab order after reloading and flickering which distract the user from object editing. Users have reported, that while objects are reloading, something moves and changes in the tab area and they always look at this area a try to understand what happens. Generally i would like some global configuration for such things in DD. So you can enable the things if you like. It's perfectly done on dataport level, but i miss global settings. But this is just my opinion, maybe you see it in another way.

BlackbitDevs commented 1 week ago

@ascheider Tab order after reloading should be the same, right? With flickering I agree - will try to find a different solution. In general, I always try to find solutions which everybody is happy with. Only if this is not possible because there are different use-cases, I will add a setting. Otherwise you will have 500 settings and nobody will know what to configure.

And you cannot imagine how difficult it is to get feedback about such features. So I am really thankful for your input!

BlackbitDevs commented 1 week ago

@ascheider I have found a solution without reloading the tab. Only the data in the fields gets updated. I think this way it is less irritating but you still always see the latest data. If you have some minutes, I am looking forward to your feedback for 3.7.x-dev version.