Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-2734

Database GetDocumentExpiration returns null instead of expected date

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1.0
    • 3.1.0
    • LiteCore
    • Security Level: Public
    • None

    Description

      LiteCore API Native.c4doc_getExpiration(_c4db, docId, &err2); did not return the expected long value (represent date time) instead it returns 0.

       

      After update to LiteCore to
      CE: f375a7fbbce062b7f3058a5c42de1befe8ee7dba
      .Net test:

      public void TestGetExpirationFromDeletedDoc()
              {
                  DateTimeOffset dto3 = DateTimeOffset.UtcNow.AddSeconds(3);
                  using (var doc1a = new MutableDocument("deleted_doc"))

      {                 doc1a.SetInt("answer", 12);                 doc1a.SetValue("options", new[]

      { 1, 2, 3 }

      );
                      Db.Save(doc1a);
                      Db.SetDocumentExpiration("deleted_doc", dto3).Should().Be(true);
                      Db.Delete(doc1a);  
                  }
                  var exp = Db.GetDocumentExpiration("deleted_doc");
                  exp.Should().BeSameDateAs(dto3); <-- failed exp is null value instead of expected date time value.
              }

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jianmin.zhao Jianmin Zhao
              sandy.chuang Sandy Chuang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty