Do the following on the recipient first – unsure at this time if the donor is ready for this.
- Make userCanceled a class member of participants of type boost::optional<bool>.
- This class member will be populated from two different sources, either the onReshardingFieldsChanges() or abort() directly from the shard's abortReshardCollection command. Both of these sources go through the abort() command eventually, so you can populate the class member there.
- Refer to userCanceled here, where you will indicate kCanceled if aborted == true && userCanceled == true, kFailure if aborted == true && userCanceled == false, and kSuccess otherwise.
- Try removing this call to onCompletion. If tests fail, keep it for now.