Skip to content

Commit

Permalink
Etag version renamed.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Jan 15, 2025
1 parent 6691920 commit b63ed03
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageProjectUrl>https://github.com/squidex/squidex</PackageProjectUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>6.25.0</Version>
<Version>6.26.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
4 changes: 2 additions & 2 deletions events/Squidex.Events.EntityFramework/FilterBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static IQueryable<EFEventCommit> ByTimestamp(this IQueryable<EFEventCommi

public static IQueryable<EFEventCommit> ByBeforeOffset(this IQueryable<EFEventCommit> q, long offset)
{
if (offset <= EtagVersion.Empty)
if (offset <= EventsVersion.Empty)
{
return q;
}
Expand All @@ -40,7 +40,7 @@ public static IQueryable<EFEventCommit> ByBeforeOffset(this IQueryable<EFEventCo

public static IQueryable<EFEventCommit> ByOffset(this IQueryable<EFEventCommit> q, long offset)
{
if (offset <= EtagVersion.Empty)
if (offset <= EventsVersion.Empty)
{
return q;
}
Expand Down
2 changes: 1 addition & 1 deletion events/Squidex.Events.Mongo/FilterBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static IEnumerable<StoredEvent> Filtered(this MongoEventCommit commit, Pa

public static IEnumerable<StoredEvent> Filtered(this MongoEventCommit commit)
{
return commit.Filtered(EtagVersion.Empty);
return commit.Filtered(EventsVersion.Empty);
}

public static IEnumerable<StoredEvent> Filtered(this MongoEventCommit commit, long position)
Expand Down
4 changes: 2 additions & 2 deletions events/Squidex.Events.Mongo/MongoEventStore_Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public IEventSubscription CreateSubscription(IEventSubscriber<StoredEvent> subsc
}
}

public async Task<IReadOnlyList<StoredEvent>> QueryStreamAsync(string streamName, long afterStreamPosition = EtagVersion.Empty,
public async Task<IReadOnlyList<StoredEvent>> QueryStreamAsync(string streamName, long afterStreamPosition = EventsVersion.Empty,
CancellationToken ct = default)
{
var commits =
Expand All @@ -43,7 +43,7 @@ await collection.Find(CreateFilter(StreamFilter.Name(streamName), afterStreamPos

var result = Convert(commits, afterStreamPosition);

if ((commits.Count == 0 || commits[0].EventStreamOffset != afterStreamPosition) && afterStreamPosition > EtagVersion.Empty)
if ((commits.Count == 0 || commits[0].EventStreamOffset != afterStreamPosition) && afterStreamPosition > EventsVersion.Empty)
{
var filterBefore =
Builders<MongoEventCommit>.Filter.And(
Expand Down
6 changes: 3 additions & 3 deletions events/Squidex.Events.Mongo/MongoEventStore_Writer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task AppendAsync(Guid commitId, string streamName, long expectedVer

var currentVersion = await GetEventStreamOffsetAsync(streamName, ct);

if (expectedVersion > EtagVersion.Any && expectedVersion != currentVersion)
if (expectedVersion > EventsVersion.Any && expectedVersion != currentVersion)
{
throw new WrongEventVersionException(currentVersion, expectedVersion);
}
Expand All @@ -59,7 +59,7 @@ public async Task AppendAsync(Guid commitId, string streamName, long expectedVer
{
currentVersion = await GetEventStreamOffsetAsync(streamName, ct);

if (expectedVersion > EtagVersion.Any)
if (expectedVersion > EventsVersion.Any)
{
throw new WrongEventVersionException(currentVersion, expectedVersion);
}
Expand Down Expand Up @@ -108,7 +108,7 @@ await collection.Find(Filter.Eq(x => x.EventStream, streamName))
return document[nameof(MongoEventCommit.EventStreamOffset)].ToInt64() + document[nameof(MongoEventCommit.EventsCount)].ToInt64();
}

return EtagVersion.Empty;
return EventsVersion.Empty;
}

private static MongoEventCommit BuildCommit(Guid commitId, string streamName, long expectedVersion, ICollection<EventData> events)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Squidex.Events;

public static class EtagVersion
public static class EventsVersion
{
public const long Auto = -3;

Expand Down
2 changes: 1 addition & 1 deletion events/Squidex.Events/IEventStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Squidex.Events;

public interface IEventStore
{
Task<IReadOnlyList<StoredEvent>> QueryStreamAsync(string streamName, long afterStreamPosition = EtagVersion.Empty,
Task<IReadOnlyList<StoredEvent>> QueryStreamAsync(string streamName, long afterStreamPosition = EventsVersion.Empty,
CancellationToken ct = default);

IAsyncEnumerable<StoredEvent> QueryAllReverseAsync(StreamFilter filter = default, DateTime timestamp = default, int take = int.MaxValue,
Expand Down

0 comments on commit b63ed03

Please sign in to comment.