Bug 34362

Summary: Stage MARC for import background job - Progress bar does not progress
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, kyle, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34354
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34364
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 31666    
Bug Blocks: 35092    

Description Pedro Amorim 2023-07-24 15:14:36 UTC
Test plan:
1) Go to stage MARC records for import
/cgi-bin/koha/tools/stage-marc-import.pl
2) Upload a .mrc file with a couple thousand records
3) Click upload file and then the bottom button "Stage for import"
4) Notice how the bar never progresses, until the job is done successfully.

I believe this is because $self->size and $self->progress are both inside $schema->storage->txn_begin and they are not updated in the database in real time until the job is successfully done.
I also think $self->progress should be $self->step but I'm not 100% sure about that one.