Bug 118285 - kmymoney online quotes are cached by KDE
Summary: kmymoney online quotes are cached by KDE
Status: RESOLVED FIXED
Alias: None
Product: kmymoney2
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Development Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-14 00:12 UTC by Michael Sims
Modified: 2009-02-18 14:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Sims 2005-12-14 00:12:55 UTC
Version:            (using KDE KDE 3.4.3)
Installed from:    Debian testing/unstable Packages

The online quotes HTTP retrieval can hit KDE's cache and thus not retrieve the most current data.

Reproduce: KDE Control Center-Internet-Web Browser-Cache: Select "Use cache whenever possible".  Retrieve an online quote (in my case, http://finance.yahoo.com/d/quotes.csv?s=USDCAD=X&f=sl1d1).  Wait at least one working day so the quote file has been updated.  Get it with Firefox or some other browser to make sure it has been updated.  Retrieve an online quote with Kmymoney - get the previous day's data, because it has been cached.  In Control Center-Internet-Web Browser-Cache, select "Clear cache".  Retrieve an online quote - get the current data, because the file is no longer in cache.

Developers who use konqueror routinely or have caching turned off wouldn't observe this, because the quote file likely wouldn't be cached the second day.  But for the users who don't use konqueror (and don't reboot their machine or otherwise clear the web cache), they can't update their online currency quotes because the old data will stay in cache.

Fix: have Kmymoney ignore the cache hit and retrieve the current data regardless of whether the page being retrieved is in the cache or not.
Comment 1 ace jones 2005-12-14 07:21:29 UTC
Fascinating.  I guess KIO::NetAccess::download hits the cache.  There
doesn't seem to be any easy way to get around this behaviour.  The
solution seems to be to use KIO::get instead, which is a bit more
complicated.

</Ace>

On Tue, Dec 13, 2005 at 11:12:57PM -0000, Michael Sims wrote:
[bugs.kde.org quoted mail]
Comment 2 Rex Dieter 2005-12-14 15:17:56 UTC
IMO, NOTABUG, what did you think "Use cache whenever possible" means?  If you can't live with the consequences of setting it, *don't use it*.
Comment 3 Tim Wunder 2005-12-14 15:45:10 UTC
Regarding comment #2:
Well, when I configure a BROWSER to use cache whenever possible, it is certainly NOT expected that my financial tracking app would use the BROWSER's cache when looking up prices.
Comment 4 Michael Sims 2005-12-14 16:07:52 UTC
This should be a situation, frankly, where it is not possible to use the cache.  Kmymoney never wants the content in the cache, since almost certainly Kmymoney caused it to be cached in the first place and the whole point of the request is to get fresh data, never stale...

The bug isn't entirely Kmymoney's fault - if Yahoo (or whoever) was properly setting the headers for its download, KDE probably wouldn't hit the cache for subsequent requests.  But since that is beyond your control, KMymoney should do the equivalent of a "shift-reload", a request that does not hit the cache.

I do not know what the default cache setting is for new KDE installations (and no doubt various distributions set it to their liking).  But you can't presume that all or even many KDE users will realize that the settings for KDE's web browser will affect the behavior of Kmymoney.

You should at least post a FAQ/workaround somewhere: "Online quotes aren't updating properly!  What should I do?"
Comment 5 ace jones 2005-12-14 17:04:03 UTC
Well, we'll post a FAQ as soon as it becomes a frequently asked
question.  So far this is the only report of a problem in this area.  I
agree it's a bug, though.  It's something we should address.

</Ace>

On Wed, Dec 14, 2005 at 03:07:53PM -0000, Michael Sims wrote:
[bugs.kde.org quoted mail]
Comment 6 Thomas Baumgart 2009-02-18 14:28:12 UTC
Changed code (actually duplicated from NetAccess) and force to bypass the cache. Hopefully I did the right thing.