Bug 499441 - Updating Stocks: Same regular expression does not work in master
Summary: Updating Stocks: Same regular expression does not work in master
Status: RESOLVED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-03 04:46 UTC by jesse
Modified: 2025-02-03 15:11 UTC (History)
0 users

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


Attachments
First image (16.96 KB, image/png)
2025-02-03 04:46 UTC, jesse
Details
Error on master (28.19 KB, image/png)
2025-02-03 04:47 UTC, jesse
Details
Online settings for 5.1.9 where it is not working (109.78 KB, image/png)
2025-02-03 04:48 UTC, jesse
Details
Online settings for 5.1.3 where it is working (38.16 KB, image/png)
2025-02-03 04:49 UTC, jesse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jesse 2025-02-03 04:46:28 UTC
Created attachment 177911 [details]
First image

SUMMARY
Updating stocks using yahoo as a source works in app image version 5.1.3-eef04f1 yet on master version 5.1.90-4fc2ef1 it does not work. 

The regular expression seems to be the same, yet on one of the it says it is not able to update the price.  

STEPS TO REPRODUCE
1. Open Kmy version 5.1.3-eef04f1 
2. go to investments
3. right click and select Update stocks and Currenty prices. 
4. 

OBSERVED RESULT
Under the version 5.1.3-eef04f1, it works fine. 
Under the version 5.1.90-4fc2ef1, it does not work. 

EXPECTED RESULT
Using the same regular expression it should work the same. 

SOFTWARE/OS VERSIONS
Windows: n/a
macOS: n/a
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Gnome 
KDE Plasma Version: n/a
KDE Frameworks Version: Version 5.115.0 
Qt Version: Version 5.15.13 (built against 5.15.12)

ADDITIONAL INFORMATION
Regular expression: 

https://query1.finance.yahoo.com/v8/finance/chart/%1
"regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)
Comment 1 jesse 2025-02-03 04:47:07 UTC
Created attachment 177912 [details]
Error on master
Comment 2 jesse 2025-02-03 04:48:14 UTC
Created attachment 177913 [details]
Online settings for 5.1.9 where it is not working

Image of the settings on master 5.1.9. It fails.
Comment 3 jesse 2025-02-03 04:49:02 UTC
Created attachment 177914 [details]
Online settings for 5.1.3 where it is working

It works with 5.1.3 but not 5.1.9 with the same reg ex.
Comment 4 Thomas Baumgart 2025-02-03 07:08:03 UTC
Your problem seems to be the missing date format. Here are the working settings for master:

Online quote settings generated with Alkimia 8.1.92-6d27032-webengine-qtnetwork

URL: https://query1.finance.yahoo.com/v8/finance/chart/%1
Download mode: Default
Data format: Stripped HTML
Identifier: 
Select by: Symbol
Price: "regularMarketPrice":((\d+|\d{1,3}(?:[,]\d{3})).\d+)
Price decimal separator: Legacy
Date: "regularMarketTime":([\d]+)
Date format: %u
Default identifier: 
Remote source: not checked

and here is the result:

(Debug) symbol=CSCO id=CSCO...
Fetching URL https://query1.finance.yahoo.com/v8/finance/chart/CSCO...
URL found: https://query1.finance.yahoo.com/v8/finance/chart/CSCO...
Symbol found: ''
Price found: '60.6' (60,6)
Date found: '1738357201'
Date format found: '1738357201' -> 'Fr. Jan. 31 2025'
CSCO CSCO Fr. Jan. 31 2025 60.6
Comment 5 jesse 2025-02-03 15:11:42 UTC
You are correct. I was missing the date format. 

That fixed the problem. 

Thanks!