Bug 507319 - org.kde.pim.pimeventsplugin is unable to get KCalendarCore::Incidence::Ptr payload from calendar items in Akonadi
Summary: org.kde.pim.pimeventsplugin is unable to get KCalendarCore::Incidence::Ptr pa...
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kdepim
Classification: Applications
Component: general (other bugs)
Version First Reported In: 6.4.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-21 17:17 UTC by Thomas Baag
Modified: 2025-08-14 19:10 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baag 2025-07-21 17:17:36 UTC
SUMMARY

Hi, since one of the latest commits (or releases in KDE terminology) the rendering of calendar items in the "Digital Clock" applet stopped working. After some digging I ended up in C++ template hell. Joy and fun for everyone.

I've found that Plasmashell retrieves the Akonadi items as expected but fails to transform the payload to a  KCalendarCore::Incidence::Ptr type. The check failing lives in the kdepim-addons package "plugins/plasma/pimeventsplugin/eventmodel.cpp".

Viewing the items in question (so all calendar items because it effects every calendar item from every calendar source I tested) in Akonadiconsole, Merkuro-Calendar or Kontact works without issues. 

Relevant part of debug log shows something like this:
plasmashell[pid]: org.kde.pim.pimeventsplugin: Populating events from collection "CollectionId"
plasmashell[pid]: org.kde.pim.pimeventsplugin: Batch: received "up to 20 it seems" items
plasmashell[pid]: org.kde.pim.pimeventsplugin: Item "a" has no payload
plasmashell[pid]: org.kde.pim.pimeventsplugin: Item "b" has no payload
...
plasmashell[pid]: org.kde.pim.pimeventsplugin: Item "t" has no payload
Continuing for every item in the batch.

STEPS TO REPRODUCE
1. Create an event in Merkuro Calendar or Kontact or sync Calendars with Nextcloud or whatever
2. Activate "Calendar Events" plugin in "Digital Clock Settings" of the Plasma clock applet
3. Make sure the Calendar for which you created the event is checked in the "Calendar Events" tab of the clock applet

OBSERVED RESULT
Event is not shown. Code was released without thorough testing. Again.

EXPECTED RESULT
Events in selected calendars from "Calendar Events" should be shown like events from other plugins (like the Holyday plugin)

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: NixOS unstable
KDE Plasma Version:  25.04.3
KDE Frameworks Version: 6.16?
Qt Version: 6.9?

ADDITIONAL INFORMATION

I hacked around in "eventmodel.cpp", added some more debug output and tried to trigger a Akonadi::PayloadException which looked like this:
plasmashell[pid]: org.kde.pim.pimeventsplugin: Item 76681 has no payload of type KCalendarCore::Incidence::Ptr. Item mimeType is "application/x-vnd.akonadi.calendar.event"
plasmashell[pid]: terminate called after throwing an instance of 'Akonadi::PayloadException'
plasmashell[pid]:   what():  Akonadi::PayloadException: Wrong Item payload type (requested: sp(2)<KCalendarCore::Incidence*>; present: sp(0)<QByteArray>, itemId: 76681)
... boring stacktrace ...
Comment 1 Thomas Baag 2025-08-14 19:10:02 UTC
Sorry for all the fuzz. This seems to be a packaging issue with NixOS.

I got it working (standalone for debugging) like this:
QT_QPA_PLATFORM=xcb QT_LOGGING_RULES="org.kde.pim.*.debug=true; " XDG_DATA_DIRS="$XDG_DATA_DIRS:/nix/store/qvwb17p40dsssidwi6jlzbyss8s7bxzk-akonadi-calendar-25.04.3/share" QT_PLUGIN_PATH="$QT_PLUGIN_PATH:/nix/store/qvwb17p40dsssidwi6jlzbyss8s7bxzk-akonadi-calendar-25.04.3/lib/qt-6/plugins" , plasmoidviewer  --applet org.kde.plasma.digitalclock

So it was missing the desktop file to find the serializer and the plugin path for the library. I had to force plasmoidviewer to use X11 as it was crashing when drawing the popup.

Will mark as resolved even if it's not because problem is further downstream.