Skip to content
Snippets Groups Projects

fix the issue

Merge request reports

Merge request pipeline passed with warnings for d14f0550

Approval is optional
Code Quality is loading
Test summary results are being parsed

Closed by Steve WirtSteve Wirt 4 months ago (Mar 22, 2025 3:51am UTC)

Merge details

  • The changes were not merged into 1.0.x.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
535 536 // Determine when to stop batching.
536 537 $sandbox['current'] = ($sandbox['total'] - count($sandbox['items_to_process']));
537 538 // Save the 'current' value to state, to record a successful processOne().
538 $this->state->set($sandbox['multi_run_state_key'], $sandbox['current']);
539 if (isset($sandbox['multi_run_state_key'])) {
  • 563 566
    564 567 $this->logger->info("$logged_message </br> $summary", $vars);
    565 568
    566 // Delete the state as it is no longer needed.
    567 $this->state->delete($sandbox['multi_run_state_key']);
    569 // Delete the state as it is no longer needed if 'multi_run_state_key' is set.
  • 435 435 return;
    436 436 }
    437 437 $this->checkAndSetCanRun($this->executor);
    438 $sandbox['multi_run_state_key'] = "cbo_{$script_name}";
    438 // Initialize multi_run_state_key if not set
    439 $sandbox['multi_run_state_key'] = isset($sandbox['multi_run_state_key']) ? $sandbox['multi_run_state_key'] : "cbo_{$script_name}";
    • This is the first run of sandbox init. There should be no other instance before this, because prior to this, $sandbox does not exist. This check is not necessary.

    • Please register or sign in to reply
  • Thank you for submitting this PR. I think the changes you are recommending solve the possibility of warning, but they also alter how the code behaves.

    After looking at the code closer as a result of this PR, the only way this warning could ever appear, is if sandbox_init was not run first or if $sandbox['total'] was not empty on the very first run.

    I have not seen this warning come up with my own eyes, but if it came up it is a sign of a bigger problem, that can not be fixed by being more defensive of $sandbox['multi_run_state_key']. I think the warning is n effect of something else, not the cause.

  • closed

  • Please register or sign in to reply
    Loading