Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.7.0: Bump SDK dependency to latest version #85

Merged
merged 6 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

## <a name="1.7.0"/> 1.7.0 - 2024-10-08

### Added

- [#85](https://github.com/Azure/Microsoft.Extensions.Caching.Cosmos/pull/85) Increased SDK dependency version for critical fixes

### Fixed

- [#85](https://github.com/Azure/Microsoft.Extensions.Caching.Cosmos/pull/85) Fix another race condition with less than 1 seconds left on sliding expiration

## <a name="1.6.2"/> 1.6.2 - 2024-08-30

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions src/CosmosCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public byte[] Get(string key)
else
{
double pendingSeconds = (absoluteExpiration - DateTimeOffset.UtcNow).TotalSeconds;
if (pendingSeconds == 0)
if (pendingSeconds < 1)
{
// Cosmos DB TTL works on seconds granularity and this item has less than a second to live.
// Return the content because it does exist, but it will be cleaned up by the TTL shortly after.
Expand Down Expand Up @@ -231,7 +231,7 @@ public void Refresh(string key)
else
{
double pendingSeconds = (absoluteExpiration - DateTimeOffset.UtcNow).TotalSeconds;
if (pendingSeconds == 0)
if (pendingSeconds < 1)
{
// Cosmos DB TTL works on seconds granularity and this item has less than a second to live.
// Treat it as a cache-miss.
Expand Down
4 changes: 2 additions & 2 deletions src/CosmosDistributedCache.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<CurrentDate>$([System.DateTime]::Now.ToString(yyyyMMdd))</CurrentDate>
<NeutralLanguage>en-US</NeutralLanguage>
<ClientVersion>1.6.2</ClientVersion>
<ClientVersion>1.7.0</ClientVersion>
<VersionSuffix Condition=" '$(IsPreview)' == 'true' ">preview</VersionSuffix>
<Version Condition=" '$(VersionSuffix)' == '' ">$(ClientVersion)</Version>
<Version Condition=" '$(VersionSuffix)' != '' ">$(ClientVersion)-$(VersionSuffix)</Version>
Expand Down Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.35.4" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.43.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/CosmosCacheTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ public async Task SlidingExpirationWithAbsoluteExpirationOnReplaceNotFound()
public async Task SlidingExpirationWithAbsoluteExpirationOnAlmostExpiredRead()
{
const int ttlSliding = 20;
const int ttlAbsolute = 500;
const int ttlAbsolute = 900;
string etag = "etag";
CosmosCacheSession existingSession = new CosmosCacheSession();
existingSession.SessionKey = "key";
Expand Down