PersonalStorage_ItemMoved e.IsMessage Problem

Hello,
PersonalStorage.SplitInto will fire ItemMoved event on each item moved.

I have a PST case with 364 items inside, when splitting, ItemMoved event will fire 364 times, OK.
The problem is that inside PersonalStorage_ItemMoved , if we check e.IsMessage , it will be True for 363 items, one is missing, although IT IS message and e.IsMessage must return True!

Project:
WindowsApplication393.zip (4.2 MB)

@australian.dev.nerds
We have opened the new investigation ticket:

Issue ID(s): EMAILNET-41050

@australian.dev.nerds,

The pst.pst storage file contains an invalid item in the Contacts folder:

EntryId	"AAAAAA8PDw8PDw8PDw8PDw8PDw+EISAA"

The Property collection does not contain a PR_MESSAGE_CLASS property to identify an item as a Message.

Outlook closed unexpectedly on this PST.
To reproduce the issue you can import the PST, then open the PST Contact folder and scroll to the bottom of the list.

int AllDoneCount = 0;
int AllMessagesCount = 0;
int AllFoldersCount = 0;

void MyTargetStorage_ItemMoved(object sender, ItemMovedEventArgs e)
{
    AllDoneCount += 1;
    if (e.IsMessage == true)
        AllMessagesCount += 1;
    else if (e.IsFolder == true)
        AllFoldersCount += 1;
    else {
        Console.WriteLine("Invalid " + e.EntryId);
    }
}

public void Test()
{
    var ASPLoadSetPST = new PersonalStorageLoadOptions();
    ASPLoadSetPST.LeaveStreamOpen = false; //Default Value Is False
    ASPLoadSetPST.Writable = false; //Default Value Is True

    using (PersonalStorage MyTargetStorage = PersonalStorage.FromFile(@"pst.pst", ASPLoadSetPST))
    {
        MyTargetStorage.ItemMoved += new ItemMovedEventHandler(MyTargetStorage_ItemMoved);
        Console.WriteLine("Total Items Inside: " + MyTargetStorage.Store.GetTotalItemsCount());
        MyTargetStorage.SplitInto(2 * 1024 * 1024, @"out");

    }
    Console.WriteLine("Total Items Moved: " + AllDoneCount);
    Console.WriteLine("Total Messages Moved: " + AllMessagesCount);
    Console.WriteLine("Total Folders Moved: " + AllFoldersCount);
}

Output:

Total Items Inside: 364
Alien AAAAAA8PDw8PDw8PDw8PDw8PDw+EISAA
Total Items Moved: 364
Total Messages Moved: 363
Total Folders Moved: 0
1 Like

ohhh thanks, appreciate it :slight_smile:

Ok, I will close this ticket.