After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761682 - KVP data containing a forward slash
KVP data containing a forward slash
Status: RESOLVED OBSOLETE
Product: GnuCash
Classification: Other
Component: Engine
git-master
Other Linux
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
: 779554 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-02-07 19:16 UTC by Bob
Modified: 2018-06-29 23:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gnucash master file (84.77 KB, application/x-gnucash)
2016-02-07 19:16 UTC, Bob
Details
gnucash 2.6.11 file (55.39 KB, application/x-gnucash)
2016-02-07 19:16 UTC, Bob
Details
CSV file with forward slashes (733 bytes, text/csv)
2016-02-07 19:17 UTC, Bob
Details
Sqlite version (89.00 KB, application/x-gnucash)
2017-08-16 09:40 UTC, Bob
Details

Description Bob 2016-02-07 19:16:04 UTC
Created attachment 320581 [details]
gnucash master file

While looking at the Bayesian kvp entries and looking to convert the way
they are stored based on the guid as opposed to the full account path I
have come across a difference between 2.6.11 and master.

What I have done is create two basic new files, one from 2.6.11 and one
from master with the account separator of / and used the CSV transaction
importer to import the enclosed file once with Bayesian turned on and once
with it of. If you look at the resulting kvp trees, in 2.6.11 you can have
a / in a slot but master treats it as an other level, you can see this more
easily in the storage of the full account path. You will also notice with
Bayesian turned off, the entries stored under "desc" appear to have over
written each other so you have only the last entry.
Comment 1 Bob 2016-02-07 19:16:41 UTC
Created attachment 320582 [details]
gnucash 2.6.11 file
Comment 2 Bob 2016-02-07 19:17:10 UTC
Created attachment 320583 [details]
CSV file with forward slashes
Comment 3 John Ralls 2017-03-06 00:58:59 UTC
*** Bug 779554 has been marked as a duplicate of this bug. ***
Comment 4 lmat 2017-05-05 16:46:47 UTC
Thank you for the bug report. I'm having a little difficulty reproducing this, can you provide quite specific reproduction instructions?

Here's what I've tried:

* Open gnucash-master
* Load "forward-slash-master.gnucash" (attached)
* Choose File > Import > Import Accounts from CSV...
* Click "Forward"
* Choose "bank-import slash.csv" (attached)
* Click Forward
* Click Apply

It looks like nothing happened, so perhaps the accounts are already imported into "forward-slash-master.gnucash"?

Anyway, if you could provide beginning-to-end reproduction instructions, what you would like to see, and what you actually see (and where you see these things), that will help tremendously. Thank you!
Comment 5 Bob 2017-05-06 10:36:47 UTC
Hi,

Sorry I did not make this clear, yes the importing works as expected but the problem is to do with the Bayesian matching...

If you look at the 2.6.11 gnucash file in a text editor and look at lines starting at 133 and the KVP keys you will see that a forward slash is permitted as the key, these have come from the the third column of the csv file which has been used as the description.

Now if you look at the master one, which I already imported the csv file into, in a text editor you will see that a forward slash is treated as part of the path and so is different. You can try importing the csv file into a current master and you will see the same thing. So this makes the Bayesian matching to fail.

Hope this makes sense now.

Bob
Comment 6 lmat 2017-05-11 18:29:32 UTC
I still don't know how to reproduce this. If you could provide beginning-to-end reproduction instructions, that would be very helpful.
Comment 7 Bob 2017-05-11 23:08:53 UTC
Ok, here goes...

Start gnucash with --nofile option
Create a basic set of accounts
Save as an uncompressed xml file
Under preferences/online banking, make sure Use baseyian matching is ticked
Select file import/transaction
use attached csv file and set...
date column 1
description column 3
deposit column 4
Set date format and Account to be a checking account
Forward/Forward
Set the accounts on the matcher to all different expense accounts
Apply and close
Save and close gnucash

Now look at the gnucash file in file editor, search for import-map-bayes and compare these keys with the layout you get in the maint version and you will see that they are different, ie you can not have a / in the key.

Does this make it clear ?
Comment 8 lmat 2017-06-27 13:48:16 UTC
Good news: these instructions seem exceptionally clear to me. Bad news: I can't reproduce the issue. Specifically, I can't find the "import-map-bayes" in the resulting file.

Here's what I did:

https://www.youtube.com/watch?v=FUOsjOk-nVw

Let me know where I went wrong.

I believe you that this is a bug, and I'm eager to fix it. I just wish I knew how to reproduce it. Once I can reproduce it, and identify the part of code that is responsible, I can fix the code and write a unit test to exercise that part of the code to make sure 1) it is right, and 2) make sure it never goes wrong again.

Thank you for your help identifying this issue.
Comment 9 John Ralls 2017-06-27 14:07:41 UTC
Are you sure you have "Use Bayesian Matching" enabled in Preferences>Online Banking? If you do and you don't have import-map-bayes keys in KVP after doing an import then something else is broken too.

Do you have "import-map" keys in KVP?
Comment 10 Bob 2017-06-28 09:13:52 UTC
I started to doubt myself so I fired up my XP VM, downloaded the latest master and installed it. Followed my procedure above and the result was as expected. Looked at your video and noticed that you did not set the accounts on the 'Matcher Page' to different expense accounts. If you leave them as unbalanced, you do not get any bay's data.
Comment 11 lmat 2017-08-15 19:46:45 UTC
Bob, are you able to reproduce this, save as a sqlite3 gnucash file on gnucash 2.6.11, and upload it here? Perhaps this is as easy as opening the xml file and "save as"ing as sqlite?
Comment 12 Bob 2017-08-16 09:40:53 UTC
Created attachment 357700 [details]
Sqlite version

Sqlite version done with file save as...

Bob
Comment 13 lmat 2017-08-16 16:20:08 UTC
Thank you for sending this. It looks like when using the sqlite backend, the behaviour is the same as master. I looked at the data in the sqlite file you gave, and it is flattened to "import-map-bayes/NEW/SAVINGS", etc. In other words, for an sqlite file, there is no way to tell whether the terminal entry should be "NEW/SAVINGS" or "NEW"/"SAVINGS". I can reproduce the problem using the XML backend, and the situation is more clear there.

It seems that this is quite an old bug, but perhaps hasn't been noticed until now. I'll continue looking and see what can be done.
Comment 14 John Ralls 2018-06-29 23:47:10 UTC
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=761682. Please continue processing the bug there and please update any external references or bookmarks.