A few bugs I ran across...

Mar 2, 2013 at 6:29 PM
I’ve been using the ASPProviders code in a couple of my Azure projects and ran across a few bugs I’ll share here.

I’m not using session at all, I am using TableStorageProfileProvider, TableStorageRoleProvider, and TableStorageMembershipProvider. I noticed some time ago that user profile blobs were getting orphaned in the profileprovidercontainer. Digging into the DeleteProfiles, I found that it attempts to do a cleanup of the blob using a call to DeleteBlobsWithPrefix and tries to remove all the blobs that start with the user name. This has two major problems:
1) Deleting blobs that start with a username can potentially delete blobs of similarly named users. For instance, deleting “Jeff” would also delete profiles for “Jeffrey”, etc.
2) Blobs are identified via a call to ListBlobs that assumes the blob URI doesn’t contain a fully qualified URI – so the StartsWith always fails.
I re-worked ListBlobs to search for a “/” + ProfileBlobName and use Contains instead of StartsWith. I pass in the full blob profile name to cleanup and do not use the username (bad bad bad).

I also found an error in the logic to save profile information. It always saves a new blob and orphans the old one. I added a call to CreateOrUpdateUserAndProfile to delete the old profile blob before saving the new one.
Coordinator
Mar 24, 2013 at 1:57 PM
Thanks for reporting this. Would you mind sharing your patch with the community?

I will fix this in the next release, but I'm bogged down with other work these days, sry.