[GNC-dev] Convert Imap to Flat

Robert Fewell 14ubobit at gmail.com
Mon Nov 5 11:07:25 EST 2018


Hi,
I was poking around with the CSV importer and I noticed the following, this
may also be an issue with other importers on first use after creating a new
file...
With a new empty xml file, I used a one line transaction csv file with
appropriate settings and the 'Account' set to 'Assets:Current
Assets:Checking Account' and observed the following when I got to the match
page...

With the 'Checking Account' register open it would partly show the imported
transactions, (this can be fixed by suspending GUI changes which I was
going to propose in a PR) and the register would reload seven times.
This reloading is caused by the triggering of the
'imap_convert_bayes_to_flat' function and as it is a new file you would not
expect it to do any thing but it does. Adding a few print statements I get
the following...

matchmap_find_destination
imap_convert_bayes_to_flat
 convert_imap_account_bayes_to_flat 'Assets'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1
 convert_imap_account_bayes_to_flat 'Current Assets'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1
 convert_imap_account_bayes_to_flat 'Checking Account'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1
 convert_imap_account_bayes_to_flat 'Liabilities'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1
 convert_imap_account_bayes_to_flat 'Income'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1
 convert_imap_account_bayes_to_flat 'Expenses'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1
 convert_imap_account_bayes_to_flat 'Equity'
  gnc_split_register_load called for account 'Assets:Current
Assets:Checking Account' with list of 1

As you can see, seven accounts get updated forcing the register reload
seven times, (not sure why those other accounts force a reload either), and
this gets even worse if this first import is 100 transactions which would
equate to 700 reloads. I have not worked out why all these accounts are
updated or why after the first pass the converted flag is not set/noticed
there by eliminating the convert for the rest of the transactions, it only
seems to be noticed on subsequent imports.

You also get this behaviour if you start the 'Import Map Dialogue' which
may be the source of a report about that dialogue freezing but that needs
more investigating.

Any idea why these accounts are updated and why it runs on every import
transaction row ?

Regards,
   Bob


More information about the gnucash-devel mailing list