Bug 342694

Summary: No warning about empty metadata
Product: [Frameworks and Libraries] frameworks-kservice Reporter: Elias Probst <mail>
Component: generalAssignee: Alex Richardson <arichardson.kde>
Status: RESOLVED WORKSFORME    
Severity: normal CC: a.samirh78, cpigat242, kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Add some temporary debugging information to kservice

Description Elias Probst 2015-01-10 14:39:38 UTC
Created attachment 90323 [details]
Add some temporary debugging information to kservice

It looks like KService doesn't properly validate the metadata in KPluginInfo.
It loads also plugins where the metadata are completely empty.

How to reproduce this/get debugging information:
- install via GHNS a new plasma wallpaper which comes as single picture (without metadata.desktop) or just drop a picture to ~/.local/share/wallpapers
- apply the attached patch to kservice
- restart plasmashell & monitor its output
- open plasmashell's "Desktop Settings" dialog
- hover the previously installed wallpaper

Every time the wallpaper is hovered, the following debug output will be shown by plasmashell:

Constructing a KPluginInfo object from old style JSON. Please use kcoreaddons_desktop_to_json() for "" instead of kservice_desktop_to_json() in your CMake code.
obj: {
                                              "KPlugin": {
                                                  "Authors": {
                                                  },
                                                  "Dependencies": [
                                                  ],
                                                  "Description": "",
                                                  "EnabledByDefault": false,
                                                  "Name": "",
                                                  "ServiceTypes": [
                                                  ]
                                              }
                                          }
plugin: {
                                              "Authors": {
                                              },
                                              "Dependencies": [
                                              ],
                                              "Description": "",
                                              "EnabledByDefault": false,
                                              "Name": "",
                                              "ServiceTypes": [
                                              ]
                                          }

This indicates that at this point, completely empty metadata are loaded which shouldn't pass validation.
Comment 1 Elias Probst 2015-01-17 00:36:19 UTC
Is https://git.reviewboard.kde.org/r/121737/ supposed to fix this? It looks related to me, but I miss the knowledge to actually tell…
Comment 2 David Faure 2015-01-22 08:18:52 UTC
Metadata isn't mandatory. It's just a way to get more info about plugins.

I don't understand what the bug would be, then?
That fromCompatibilityJson is being called at all?
Comment 3 Ahmad Samir 2021-08-25 21:57:14 UTC
Is this issue still valid?
Comment 4 Bug Janitor Service 2021-09-09 04:36:03 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Bug Janitor Service 2021-09-24 04:35:38 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!