Menu

#32 Storage Deletion Bug

v2.0.1
closed-fixed
Federico
None
5
2016-12-15
2015-11-17
No

If you add four storage objects, then delete the last one some of the previous elements loose their childrne.
The following test shows this bug.

        [TestMethod]
    public void Test_CompoundFile_Delete_ChildElementMaintainsFiles()
    {
      using (var compoundFile = new CompoundFile())
      {
        // Only works if d is the last storage added.
        // Works if four elements exist, middle element persists. 
        var storage1 = compoundFile.RootStorage.AddStorage("b");
        var storage2 = compoundFile.RootStorage.AddStorage("c");
        var storage3 = compoundFile.RootStorage.AddStorage("a");
        var storage4 = compoundFile.RootStorage.AddStorage("d");
        storage1.AddStream("A.1");
        compoundFile.RootStorage.Delete("d");
        storage1 = compoundFile.RootStorage.GetStorage("a");
        storage1.GetStream("A.1");
      }
    }

It is expected not to fail, but A.1 is not found.

Discussion

  • Federico

    Federico - 2015-11-21
    • status: open --> accepted
    • assigned_to: Federico
     
  • Federico

    Federico - 2015-11-25
    • status: accepted --> pending
     
  • Federico

    Federico - 2015-11-25

    The example provided IS expected to fail: in your code stream A.1 is added to storage b, not to storage a where you are trying to retrive it.
    Please, let me know if I've misunderstood your post.
    Best Regards,
    Federico

     
  • Daniel Miller

    Daniel Miller - 2015-11-30

    My apoligies there.
    A bug where the symptoms suggested in the test did occur, but this is a bad test (and I jumped the gun on posting it).
    I will look for the case where it actually looses children, this one is fine.

    Thank you for pointing that out.

     
  • Federico

    Federico - 2016-12-15
    • status: pending --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB