Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statusbar during ofx download #1940

Merged

Conversation

christopherlam
Copy link
Contributor

@christopherlam christopherlam commented May 18, 2024

While processing ofx download, it will delete previously imported[*] transactions. Due to the slow transaction deletion performance, this delay may be significant e.g. ~4 seconds while processing an ofx with only 63 transactions.

Add a statusbar message to show the UI isn't frozen.

Yak shaving requested: any better wording for the statusbar message?

I thought about utilising the progress bar, however, due to the deletion of transactions, it causes the UI to update too often[**].

image

[*] gnc_gen_trans_list_add_trans will check (gnc_import_exists_online_id (trans, gui->acct_id_hash)) which triggers the transaction deletion.
[**] try this patch to test:

modified   gnucash/import-export/ofx/gnc-ofx-import.cpp
@@ -1304,6 +1304,7 @@ runMatcher (ofx_info* info, char * selected_filename, gboolean go_to_next_file)
      * create duplicate entries.
      */
     info->num_trans_processed = 0;
+    auto len = g_list_length (info->trans_list);
 
     gnc_window_show_progress (_("Processing and removing already imported transactions..."), 100);
 
@@ -1314,6 +1315,7 @@ runMatcher (ofx_info* info, char * selected_filename, gboolean go_to_next_file)
     // appear.
     for(GList* node = info->trans_list; node; node=node->next)
     {
+        gnc_window_show_progress ("Processing transactions", info->num_trans_processed * 100 / len);
         auto trans = static_cast<Transaction*>(node->data);
         Split* split = xaccTransGetSplit (trans, 0);
         Account* account = xaccSplitGetAccount (split);

@jralls
Copy link
Member

jralls commented May 19, 2024

The function you put that in de-duplicates the imported transaction list and adds the transactions to the match list. Removing already-imported transactions is done by the matcher with that match list, so I'd go with "Removing duplicate transactions".

@christopherlam christopherlam force-pushed the statusbar-ofx-download branch from 0374229 to 11059ed Compare May 20, 2024 01:07
@christopherlam christopherlam force-pushed the statusbar-ofx-download branch from 11059ed to 0df1372 Compare May 20, 2024 04:45
@christopherlam christopherlam marked this pull request as ready for review May 20, 2024 05:01
@code-gnucash-org code-gnucash-org merged commit 2d030c5 into Gnucash:stable May 20, 2024
4 checks passed
@christopherlam christopherlam deleted the statusbar-ofx-download branch May 20, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants