Repository navigation
fix(exchange): load Encrypted Email Count from the input CSV - #227
Merged
Merged
Conversation
_resolve_target_users detected the column, so it skipped auth and the encrypted scan, but _prepare_batch_list never copied the values, so every row kept 0. Load it like the other count columns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a CSV containing an
Encrypted Email Countcolumn was used as input with Encrypted Emails ticked:_resolve_target_usersdetected the column (have_encrypted_email = True), so it treated encrypted data as present: no live scan was considered necessary for it andMail.Readwasn't requested._prepare_batch_listnever copied the column, so every row kept the defaultEncrypted Email Count = 0andstats["encrypted_emails"]was 0._run_scan_phases,has_encrypted_email_datawas therefore False:Since encrypted emails are much slower to migrate, losing the counts also made batch ETAs too optimistic (all emails were treated as unencrypted).
Fix
Load the column like every other count column:
have_encrypted_email = "Encrypted Email Count" in sample, thensafe_int(src.get(...))for user rows whenscan_encrypted_emailis ticked. Shared and group rows are unchanged (the encrypted scan only covers user mailboxes today).Testing
Encrypted Email Count7 and 0): after the fix rows load 7/0,stats.encrypted_emails = 7and the encrypted phase logs Skipping Encrypted Email Scan (Data present...); unticked doesn't load it. Before the fix rows were 0/0.