1
Vote

Export issues with AttributeChange.CreateAttributeAdd()

description

in MAExport.cs:

When processing export results and attribute updates, multiple issues have been detected:
  1. When returningatrtibute update with arrays, there are two issues:
a. the trace code somehow works but sends 'System.Object[]' or 'System.String[]' (...) to the trace because of implicit conversion from an array sends the type name, not the "content" itself. Not a big issue, instead I have modified the code on my local copy to send the size of the array (trying to display the entire array in the trace isn't good for performance, I think.

b. Still with arrays, and a real issue this time: the AttributeChange.CreateAttributeAdd() has two overloads. The problem of sending hashtable[key] as argument creates an issue where array values are only sent as objects and not as arrays of objects. Therefore the wrong call to AttributeChange.CreateAttributeAdd() is made. It is required to make an explicit cast (object[]) when exported value is an array.
  1. Ideally (I think it's a missing piece), when hashtable[key] == null it would be better to send an AttributeChange.CreateAttributeDelete(key) instead. This is currently not handled in the code, I think.
See attachment for suggested fixes & enhancements.
(around lines 169-190)

file attachments

comments

Granfeldt wrote Nov 17, 2016 at 6:46 AM

Thank you. I'll have a lot into it for next version