Bug 381517

Summary: Online web price update could not be canceled in case of network issues
Product: [Frameworks and Libraries] alkimia Reporter: Ralf Habacker <ralf.habacker>
Component: GeneralAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 8.0.4   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 8.1.3
Sentry Crash Report:

Description Ralf Habacker 2017-06-22 07:26:47 UTC
In case of network problems or configuration issues the update of online web price updates could not be canceled. It is required to wait until the network connection times out which may require one minute and additional one minute if the stock account uses a different currency compared with the base account.

How to reproduce:
1. start kmymoney
2. goto to settings->online web quotes and apply the changes from bug 381399 comment 5 to the "Financial Times UK Funds" entry.
3. Add a new investment account 
4. Create a new investment by selecting the account created with 3. and use EUR currency.
5. open context menu and select "new investition" 
6. add 'LU0063916489' as stock symbol, name it 'test' and use USD currency
7. press okay, select "Financial Times UK Funds" and press okay
8. select "online price update" in just created investment from the context menu

What happens:
Pressing the cancel button does not have any effect

What is expected:
On pressing the cancel button the current network operation should be canceled immediatly
Comment 1 Ralf Habacker 2020-10-26 11:07:12 UTC
Moved to alkimia because web price support inside kmymoney is deprecated and will not get any further updates.

The 4.8 branch already uses the online course support of alkimia, and 5.1 may have this on the basis of a kmymoney plugin. 

To do so, the class WebPriceQuote would have to be converted to a KMyMoney plugin to make it optional. Based on this another plugin can be added, which uses the corresponding classes of alkimia and can be used alternatively.
Comment 2 Ralf Habacker 2020-10-27 10:15:18 UTC
In the "native" start mode it is necessary to refactor AlkOnlineQuote::Private::downloadUrl() so that no local event loop is used. Instead, it should store the job in the class to be able to process or abort it later. To handle the cancel request a new slot should be defined, e.g. bool AlkOnlineQuote::Private::cancelDownload() and in 
AlkOnlineQuotesWidget::Private::slotCheckEntry() the call to setupIcons() must be moved to a separate slot, which will be called after the download is finished

Translated with www.DeepL.com/Translator (free version)
Comment 3 Ralf Habacker 2023-09-23 10:44:16 UTC
Git commit 3e17fe92caf6ea8cb88c762bc222367c7579fbd9 by Ralf Habacker.
Committed on 23/09/2023 at 12:43.
Pushed by habacker into branch '8.1'.

Add support to set timeout for network requests
FIXED-IN:8.1.3

M  +33   -2    src/alkonlinequote.cpp
M  +20   -1    src/alkonlinequote.h

https://invent.kde.org/office/alkimia/-/commit/3e17fe92caf6ea8cb88c762bc222367c7579fbd9