I rearranged the code, so that for the 3 createDocument/Folder methods, there is only one that actually does the work (the other 2 calling into it with aspect/type set to nil, depending on the call). Maybe the diff is getting confused ?
I checked my code, and I can see the contentStream.length > 0 check being done both in the create and update content methods.