You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In FileStore.Barrel the DateTimeToEpochSeconds converts the expiration date to second from epoch in seconds as an int. This overflows in about 6050 days from now and becomes int.MinValue, which means it is considered expired. This int should probably be a long instead.
If I have time I'll try to patch this, but I wanted to mention this. Also, I didn't look at the other implementations, only FileStore.
In case you're wondering, I found this problem by trying to set a very distant expiration date. Initially I tried TimeSpan.MaxValue but that had this problem. I then tried TimeSpan.FromDays(9999) and had the same problem. Then I looked at the code and found the problem. I also think that TimeSpan.MaxValue should possibly be considered special and never expire.
The text was updated successfully, but these errors were encountered:
Could this also be causing a System.ArgumentOutOfRangeException when calling Barrel.Current.Add(key, value, TimeSpan.MaxValue);? The error message is: The added or subtracted value results in an un-representable DateTime.
Parameter name: value'. Looks like a regression of #30.
Changing the call to Barrel.Current.Add(key, value, TimeSpan.FromDays(6000)); seems to work as a workaround.
@jamesmontemagno
In
FileStore.Barrel
theDateTimeToEpochSeconds
converts the expiration date to second from epoch in seconds as an int. This overflows in about 6050 days from now and becomesint.MinValue
, which means it is considered expired. Thisint
should probably be along
instead.If I have time I'll try to patch this, but I wanted to mention this. Also, I didn't look at the other implementations, only
FileStore
.In case you're wondering, I found this problem by trying to set a very distant expiration date. Initially I tried
TimeSpan.MaxValue
but that had this problem. I then triedTimeSpan.FromDays(9999)
and had the same problem. Then I looked at the code and found the problem. I also think thatTimeSpan.MaxValue
should possibly be considered special and never expire.The text was updated successfully, but these errors were encountered: