Summary: | Smart dates in message list still show "today" for messages received yesterday | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | Thiago Macieira <thiago> |
Component: | message list | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | asturm, axel.braun, kde, vkrause |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 24.08.3 | |
Sentry Crash Report: | |||
Attachments: |
Screenshot showing the problem
Problem in KMail 6.1.2 |
Description
Thiago Macieira
2024-03-21 01:53:29 UTC
Created attachment 167535 [details]
Screenshot showing the problem
Still happening as of KMail 6.1.0. Created attachment 171892 [details]
Problem in KMail 6.1.2
*** Bug 484805 has been marked as a duplicate of this bug. *** I'm not familiar with the KDE PIM code base, but after digging into it I might have a lead. `MessageList::Core::Manager` - which has singleton characteristics - holds a `MessageCore::DateFormatter` object in a member variable named `mDateFormatter`: https://invent.kde.org/pim/messagelib/-/blob/46b22c6d85a63ae70f6822078b4846ec548d70cc/messagelist/src/core/manager.cpp#L33 `MessageCore::DateFormatterPrivate` has a member variable named `mTodayOneSecondBeforeMidnight`, which holds the reference time point for 'today' (and, by extension, for 'yesterday'). That variable is initialised lazily exactly once: https://invent.kde.org/pim/messagelib/-/blob/46b22c6d85a63ae70f6822078b4846ec548d70cc/messagecore/src/utils/dateformatter.cpp#L161 So, in summary, we have a singleton object holding a long-lived date-formatter object containing a reference time point that never gets updated over the lifetime of the application. Draft fix, currently untested: https://invent.kde.org/pim/messagelib/-/merge_requests/246 A possibly relevant merge request was started @ https://invent.kde.org/pim/messagelib/-/merge_requests/247 |