Count in drush output AND completed status in UI is sometimes off by 1

Created on 30 June 2024, 6 months ago
Updated 1 July 2024, 6 months ago

Problem/Motivation

For some batch operations, it appears that there is a miscount on both the output when running by drush or seeing the completed status in the Batch operation UI

Processed item_11. [85%] [12/14]
Processed item_12. [92%] [13/14]
Process completed: Tried 14 out of 14 cron strings. See the log for debug and manual validation.

The item count says 12 but starts at 0 so it means 13. However the totals reported say 14. So it looks like a difference of 2 but is really only off by 1.

However others, the count is correct. Something seems flimsy here. Ought to adjust the item output to not start at 0 as well. It leads to confusion.

Steps to reproduce

  1. In the UI run TestDo10Things
  2. Look at the related log display. It will show the right completed count
  3. In the terminal run `drush codit-batch-operations:run TestDo10Things` It will show the right count in the log and the terminal.
  4. In the UI run TestAllCronTimeStrings
  5. Look at the related log display, notice the count is off.
  6. In the terminal run `drush codit-batch-operations:run TestAllCronTimeStrings` Notice the count in the terminal is off and so is the count in the status display

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States swirt Florida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024