jpahullo / moodle-tool_mergeusers

Merge users script for Moodle
https://moodle.org/plugins/view.php?plugin=tool_mergeusers
22 stars 50 forks source link

repeat merging operation after success #234

Closed jpahullo closed 1 year ago

jpahullo commented 1 year ago

We have made an unexpected finding.

While merging action was being made, there were actions logged in with the old user that were not merged into the new one.

So, in conclusion, to prevent islands of information, merging users should be once more after a success, to cover this scenario (more common that expected):

  1. Person using the old username navigates through Moodle normally.
  2. Merging action is in progress.
  3. Person using the old username still navigates through Moodle normally.
  4. Merging action concludes with success.
  5. That event makes deactivate that old username, so that person can only use the new username.
  6. With high probability, not all the records are migrated from the old username to the new username.
  7. So, repeating the merging action, with the old username deactivated, ensures any pending record with the old username is migrated to the new username.

We cannot deactivate the old username beforehand, since the merging action can fail, and it would prevent that person to access to the information existing, at the moment, only with the old username.

jpahullo commented 1 year ago

This is being implemented as part of the #207.

closing in favor of #207