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

Built admin plugins not compatible in version 6.4.10.0 #2420

Closed
jlaute opened this issue Apr 6, 2022 · 36 comments
Closed

Built admin plugins not compatible in version 6.4.10.0 #2420

jlaute opened this issue Apr 6, 2022 · 36 comments
Labels

Comments

@jlaute
Copy link
Contributor

jlaute commented Apr 6, 2022

PHP Version

7.4 & 8.0

Shopware Version

6.4.10.0

Expected behaviour

Admin plugins that are built under Shopware < 6.4.10.0 should be compatible with Shopware 6.4.10.0 either and vice versa.

I can also not use a plugin that is built under 6.4.10.0 in shopware <= 6.4.9.0

Actual behaviour

Plugin is built with bin/build-administration.sh under Shopware 6.4.9.0. The compiled .js file should also work under 6.4.10.0.

There is no error message in the admin and also no error message in the developer console.

How to reproduce

Just call bin/build-administration.sh in a shopware version smaller than 6.4.10.0 and try to use this in 6.4.10.0.

@jlaute jlaute added the Bug label Apr 6, 2022
@phit
Copy link

phit commented Apr 7, 2022

my best guess right now is that it's somehow related to NEXT-20067 which changed how components are loaded, this also doesn't seem to affect all plugins

@jlaute
Copy link
Contributor Author

jlaute commented Apr 10, 2022

Yes you are right, this seems to not affect all plugins. I had two different scenarios:

  1. One Plugin is built with 6.4.9.0 works only there and not in 6.4.10.0. The same plugin built with 6.4.10.0 does not work in 6.4.9.0.
  2. Another Plugin is built with 6.4.9.0 and not works in 6.4.10.0. The same plugin built with 6.4.10.0 does work in 6.4.9.0.

@cuonghuynh
Copy link
Contributor

I got the same issue

@sschreier
Copy link

I have the same problem. Everything was only displayed again when I regenerated the compiled files via administration:build (the content is now different and a .map file was added).

@tpierschel
Copy link

Have the same problem with our plugins.

@jleifeld
Copy link
Contributor

We are working currently on a solution for this problem. A quick fix would be to rebuild the plugin with a Shopware version equal or greater than 6.4.5.0. Then it should be compatible with all Shopware 6.4 versions.

@tpierschel
Copy link

tpierschel commented Apr 14, 2022

as mentioned here: #2420 (comment) the quickfix doesnt work.

@jleifeld
Copy link
Contributor

Thats strange. I tested several plugins and they had all the same behavior. Could someone send me a plugin where this problem can gets reproduced?

@sschreier
Copy link

sschreier commented Apr 14, 2022

You can see the problem in the plugin https://store.shopware.com/frosh97876597450f/mail-archive.html in Version 0.3.1 (in Version 0.3.2 it was already fixed by updating the compiled files under public/administration/js). When you use the plugin in Version 0.3.1 in Shopware Version 6.4.10.0, the menu item under "Settings" -> "Extensions" -> "Mail Archive" doesn't appear.

@htkassner
Copy link
Contributor

This is not a good example as this is now solved with 0.3.2. We need a plugin where the rebuild with a Shopware version >= 6.4.5.0 does not work in 6.4.10.

@sschreier
Copy link

OK. I had understood that the actual problem is that the compiled files have to be regenerated in general since Shopware version 6.4.10.0.

@htkassner
Copy link
Contributor

No it is more like: older versions should be recompiled with a version >= 6.4.5.0 to work with the latest version. Maybe @jleifeld can explain this a bit more detailed as he is intensively investigating the last days.

@jleifeld
Copy link
Contributor

@sschreier Thanks for your plugin suggestion! I investigated and tried out some things. I build the mail-archive plugin in the latest trunk and tested the builded version in 2 older Shopware versions:

Bildschirmfoto 2022-04-14 um 15 19 06

Bildschirmfoto 2022-04-14 um 15 23 58

The newly created build is working without problems in the versions you see in the screenshot. One thing I noticed is that after the plugin activation the automatic reloads happens and then the plugin does not work directly. Only after a manual reload. It seems like that the bundle does not get detected directly. But this happens only once after the activation and does not happen on newer Shopware versions.

Could it be the case that you saw this and thought that the newly build plugin does not work because of this?

@sschreier
Copy link

Hello @jleifeld , i mean Version 0.3.1 of the plugin https://store.shopware.com/frosh97876597450f/mail-archive.html and Shopware Version 6.4.10.0. When you use this version, it doesn't work in Shopware Version 6.4.10.0 (only when you updating the compiled files under public/administration/js). In all versions below 6.4.10.0 Version 0.3.1 works correctly.

@htkassner
Copy link
Contributor

We have a circular reference here. Just to make it clear: Version 0.3.1 will not be working. Never ever. No matter what. Just update to 0.3.2 which was compiled with an SW version >= 6.4.5.0

@sschreier
Copy link

Hello @htkassner, i know, but below 6.4.10.0 the version 0.3.1 works perfectly - that was what i mean.

@sobyte
Copy link
Contributor

sobyte commented Apr 14, 2022

For our plugin, the workaround to build the plugin with Shopware 6.4.5.0 has worked. We can use the plugin in Shopware 6.3.0.0 and 6.4.10.0 without the need to re-compile.

@htkassner
Copy link
Contributor

We know that. 6.4.10.0 contains a necessary change for the plugin build process. This fix caused problems only in versions that were build with older versions < 6.4.5.0. That´s why we will inform plugin manufacturers to rebuild their plugins with a version >= 6.4.5.0. As many manufacturers rebuild their plugins quite often, this does not affect a huge amount of plugins. We know that this is kind of annoying but a new build is the easiest and most painless fix for that. Otherwise we would have to include another set of 1.6MB javascript for everyone, which is absolutely not relevant for everyone. So thats why we say. Please rebuild with newer SW version and it will be solved. Thank you for this discussion

@sobyte
Copy link
Contributor

sobyte commented Apr 14, 2022

@htkassner Relevant side note: We've also tested the build with 6.4.9.0 and like already stated (#2420 (comment)) the plugin didn't work directly in 6.4.10.0. So your condition >= 6.4.5.0 might not be 100% true 😉

@jlaute
Copy link
Contributor Author

jlaute commented Apr 14, 2022

I had problems with this plugin: https://store.shopware.com/jlau706451421896/als-kunde-einloggen.html (You should see a button in customer listing and customer detail page)

Build with 6.4.9.0 is not working in 6.4.10.0
Build with 6.4.10.0 is not working in 6.4.9.0

This is quite annoying, because I have to build the plugin under multiple shopware versions for a little bugfix and upload it with different Shopware compatibilities to the store again.

@htkassner
Copy link
Contributor

@sobyte The thing is, that this was the only case we could reproduce the problem. If you guys deliver more and detailed information we will investigate on this further of course.

@jleifeld
Copy link
Contributor

@jlaute I tested following with your plugin: Build with 6.4.10.0 is not working in 6.4.9.0. I build it in 6.4.10 with the normal development setup. For me it works in both versions:

Bildschirmfoto 2022-04-19 um 08 22 58

Bildschirmfoto 2022-04-19 um 09 00 21

Can you describe your whole setup and write a detailed how-to-reproduce guide for the bug? Otherwise it is really difficult to find out what is the difference between your setup and the "standard" setup :)

@tpierschel
Copy link

@jleifeld - can you confirm and promise if we compile all of our plugins with the 6.4.10.x version that the compiled version works in ALL shopware 6.4.X versions ? - f.e. 6.4.0.x and up?

@jleifeld
Copy link
Contributor

@tpierschel I tested several plugins which were reported by the community, as an example the "Login as customer" plugin. And it works back to the 6.4.0.x and up. To confirm it I tested also the plugin on the 6.4.0.0 and it works:

Bildschirmfoto 2022-04-19 um 10 57 49

You can see in all screenshots the version in the top left next to the Shopware logo.

@jlaute
Copy link
Contributor Author

jlaute commented Apr 19, 2022

Okay so I have built it again under different Shopware versions and tested the output.

I can not reproduce my previously described bahaviour.... building under 6.4.9.0 works now in 6.4.10.0 and vice versa...
Even though I had bug reports in 6.4.10, because the buttons disappeared in the admin and my own tests failed too.

I used the images dockware/dev:6.4.10.0 and dockware/dev:6.4.9.0 and mounted the plugin to the container.

This is strange. I will make some more tests and try to reproduce it.

@htkassner
Copy link
Contributor

Thanks for your effort. That´s the point. We also can not reproduce it. But if we will of course take care.

@jlaute
Copy link
Contributor Author

jlaute commented Apr 19, 2022

I have now found out a little more. The plugin still had an old .js file that was built under 6.4.x at some point. This file does not work under 6.4.10.0, but it does under 6.4.9.0.

What @jleifeld wrote, I can confirm in the meantime also. Built javascript under 6.4.10.0 works also in 6.4.0.0. That would be for me already an acceptable solution.

However, it is not particularly nice that in a feature release without announcement the plugin no longer works and you have to rebuild it first.

Here is a little table for a better overview:

Plugin Version Build Version 6.4.0.0 6.4.9.0 6.4.10.0
1.3.7 6.4.0.0
1.3.7 6.4.9.0
1.3.7 6.4.10.0

@tpierschel
Copy link

However, it is not particularly nice that in a feature release without announcement the plugin no longer works and you have to rebuild it first.

I completely agree - i dont understand why Shopware didn't postpone this breaking change to 6.5 and why there was no announcement about this issue - it costs us a lot of time and uneeded effort.

@jleifeld
Copy link
Contributor

jleifeld commented Apr 19, 2022

However, it is not particularly nice that in a feature release without announcement the plugin no longer works and you have to rebuild it first.

I completely agree - i dont understand why Shopware didn't postpone this breaking change to 6.5 and why there was no announcement about this issue - it costs us a lot of time and uneeded effort.

The issue was not known before because the change was tested with several plugins and every plugin was working correctly. And none of these plugins were built before 6.5.0. So we thought that this change will be non breaking. Due to the high flexibility and complexity of the plugin system it is not possible to cover every edge case. We try our best to cover all possible problems by testing as many cases as possible. But there are some rare cases where we can't find out that it is breaking. And this case is one of these cases.

@danielDigitalArt
Copy link

Hi there,
is it really that simple?

I have a test-shop running, i guess it started with version 6.2 and was then constantly updated, right now the point for extensions has vanished, although the paypal plugin is installed here.

image

image

Also when i go over to the position "Store" in the backend, i wants to activate the store plugin (which is already enabled) when i click confirm it gives a success message and then goes back to the store page, stating that the plugin needs to be activated:

image

When i remember it correctly the paypal and store plugin should be updated with the shop system aswell, i guess the plugins did not receive an update in a while and thus did not get updated, maybe on newer shop installations it downloads a correctly build version but for older installations it seems to be a problem.

@jleifeld
Copy link
Contributor

Hi there, is it really that simple?

I have a test-shop running, i guess it started with version 6.2 and was then constantly updated, right now the point for extensions has vanished, although the paypal plugin is installed here.

image

image

Also when i go over to the position "Store" in the backend, i wants to activate the store plugin (which is already enabled) when i click confirm it gives a success message and then goes back to the store page, stating that the plugin needs to be activated:

image

When i remember it correctly the paypal and store plugin should be updated with the shop system aswell, i guess the plugins did not receive an update in a while and thus did not get updated, maybe on newer shop installations it downloads a correctly build version but for older installations it seems to be a problem.

I see in the screenshots that your PayPal version and Store version are outdated:

Your PayPal version: 3.2.1
Current PayPal version: 5.0.3

Your Store version: 1.1.0
Current Store version: 1.6.0

Can you try to update your plugins and see if this works?

@danielDigitalArt
Copy link

That is the funny thing, i simply updated the shop system when there was an update, the system also said that the plugins are compatible and do not require an update or anything. Right now i do not see an option to update the plugins, i can only uninstall them:
image
So i guess, that this installation reached a dead end here, as i am not able to update the plugin normally (like most people would do from within the backend).
I do not really mind, that it does not work here for me, as this is just a testshop, but what happens for those shops who also simply update the shop and did not yet update the plugins, as the shop never requested them to do so?

@danielDigitalArt
Copy link

Ich musste mich aus dem Shopware Account einmal ausloggen und wieder einloggen, danach wurde mir der Link zum Aktualisieren angeboten.
image

Nach dem Re-Login wurden auch wieder zusätzliche Optionen in dem 3-Punkt-Menü angezeigt, die vorher noch nicht da waren, bspw. die Details anzusehen, oder das Plugin zu bewerten.

Nach dem Plugin-Update taucht dann auch der Bereich Erweiterungen in den Einstellungen wieder auf.

Ggf. sollte der Update-Prozess hier vielleicht vorher kurz die validität des Logins überprüfen und zur not automatisch ausloggen, denn auch das Update auf 6.4.10.1 konnte die Plugin-Kompatibilität nicht rpfüen, es gab hier immer einen 500er Fehler im Ajax-Aufruf. Jetzt nach Login und Paypal & Store Update, werden die Inhalte fertig geladen.

@htkassner
Copy link
Contributor

I will take this with me and inform the right people. Maybe we can optimize the flow here. Nice that it finally worked for you

@jleifeld
Copy link
Contributor

We introduced an unwanted breaking change in the Shopware version 6.4.10.0 for plugins. The problem caused by that only happens to plugins which were built with a Shopware version which is older than 6.4.5.0. All plugins built with 6.4.5.0 and higher should work as expected.

The problem causes that the plugin code does not get executed in the administration anymore. The solution to this problem is to rebuild the plugin with a Shopware version greater or equal to 6.4.5.0. This assures that the plugin is then compatible with all Shopware 6.4 versions - even the older ones.

The reason for the change we made, was that the chunk loading of Webpack could have conflicts between different plugins. If this happens some plugins don't work correctly. This happens due to a shared runtime where one plugin overwrites a chunk of another plugin.

To solve this problem we introduced a separated runtime variable for each plugin so that they don't get into conflict with some other plugins. This change was a break but we didn't recognized it before the release because none of our tested plugins were built with a Shopware version older than 6.4.5.0. We are very sorry for that.

All plugins built with 6.4.5.0 and higher are built with our refactored build-process which uses the Webpack multi compiler. This guarantees that the plugin does not conflict with other plugins and work on their own. Mentioned plugins aren't affected by this problem.

@htkassner
Copy link
Contributor

@danielDigitalArt Regarding your topic with the update which was not shown. This is currently in progress internally and will be fixed in one of the next releases.

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

No branches or pull requests

9 participants