Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit ec83ff7

Browse files
committed
Update dependency versions to the latest versions
1 parent 912bc14 commit ec83ff7

File tree

10 files changed

+55
-43
lines changed

10 files changed

+55
-43
lines changed

build.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Param(
3131

3232
$FakeVersion = "4.61.2"
3333
$NBenchVersion = "1.0.1"
34-
$DotNetChannel = "preview";
35-
$DotNetVersion = "1.0.4";
36-
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1";
34+
$DotNetChannel = "LTS";
35+
$DotNetVersion = "3.1.100";
36+
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
3737
$NugetVersion = "4.1.0";
3838
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/v$NugetVersion/nuget.exe"
3939
$ProtobufVersion = "3.2.0"

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ NUGET_EXE=$TOOLS_DIR/nuget.exe
1010
NUGET_URL=https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe
1111
FAKE_VERSION=4.61.2
1212
FAKE_EXE=$TOOLS_DIR/FAKE/tools/FAKE.exe
13-
DOTNET_VERSION=1.0.4
14-
DOTNET_INSTALLER_URL=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh
13+
DOTNET_VERSION=3.1.100
14+
DOTNET_INSTALLER_URL=https://dot.net/v1/dotnet-install.sh
1515

1616
# Define default arguments.
1717
TARGET="Default"

src/Akka.Persistence.PostgreSql.Tests/Akka.Persistence.PostgreSql.Tests.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Docker.DotNet" Version="3.125.2" />
11-
<PackageReference Include="Akka.Persistence.Sql.Common" Version="$(AkkaVersion)" />
1211
<PackageReference Include="Akka.Persistence.Sql.TestKit" Version="$(AkkaVersion)" />
1312
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
1413
<PackageReference Include="Microsoft.Extensions.Configuration" Version="1.1.2" />
1514
<PackageReference Include="Npgsql" Version="$(PostgresVersion)" />
1615
<PackageReference Include="xunit" Version="$(XunitVersion)" />
17-
<DotNetCliToolReference Include="dotnet-xunit" Version="$(XunitVersion)" />
1816
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
1917
</ItemGroup>
2018

src/Akka.Persistence.PostgreSql.Tests/Json/PostgreSqlJournalJsonSpec.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class = ""Akka.Persistence.PostgreSql.Journal.PostgreSqlJournal, Akka.Persistenc
3838
}");
3939
}
4040

41+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
42+
protected override bool SupportsSerialization => false;
43+
4144
public PostgreSqlJournalJsonSpec(ITestOutputHelper output, PostgresFixture fixture)
4245
: base(Initialize(fixture), "PostgreSqlJournalJsonSpec", output: output)
4346
{

src/Akka.Persistence.PostgreSql.Tests/Json/PostgreSqlSnapshotStoreJsonSpec.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ public PostgreSqlSnapshotStoreJsonSpec(ITestOutputHelper output, PostgresFixture
4545
Initialize();
4646
}
4747

48+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
49+
protected override bool SupportsSerialization => false;
50+
4851
protected override void Dispose(bool disposing)
4952
{
5053
base.Dispose(disposing);

src/Akka.Persistence.PostgreSql.Tests/PostgreSqlJournalSpec.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class = ""Akka.Persistence.PostgreSql.Journal.PostgreSqlJournal, Akka.Persistenc
3939
return ConfigurationFactory.ParseString(config);
4040
}
4141

42+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
43+
protected override bool SupportsSerialization => false;
44+
4245
public PostgreSqlJournalSpec(ITestOutputHelper output, PostgresFixture fixture)
4346
: base(Initialize(fixture), "PostgreSqlJournalSpec", output: output)
4447
{

src/Akka.Persistence.PostgreSql/Akka.Persistence.PostgreSql.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
<PropertyGroup>
55
<AssemblyTitle>Akka.Persistence.PostgreSql</AssemblyTitle>
66
<Description>Akka Persistence journal and snapshot store backed by PostgreSql database.</Description>
7-
<TargetFrameworks>$(NetFrameworkVersion);$(NetStandardLibVersion)</TargetFrameworks>
7+
<TargetFrameworks>$(NetStandardLibVersion)</TargetFrameworks>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9-
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.1</NetStandardImplicitPackageVersion>
109
</PropertyGroup>
1110

1211
<ItemGroup>

src/Akka.Persistence.PostgreSql/Journal/PostgreSqlQueryExecutor.cs

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Data;
1818
using System.Data.Common;
1919
using System.Linq;
20+
using System.Runtime.CompilerServices;
2021
using System.Text;
2122

2223
namespace Akka.Persistence.PostgreSql.Journal
@@ -60,20 +61,28 @@ public PostgreSqlQueryExecutor(PostgreSqlQueryConfiguration configuration, Akka.
6061
case StoredAsType.ByteA:
6162
_serialize = e =>
6263
{
63-
var serializer = Serialization.FindSerializerFor(e.Payload);
64-
return new SerializationResult(NpgsqlDbType.Bytea, serializer.ToBinary(e.Payload), serializer);
64+
var payloadType = e.Payload.GetType();
65+
var serializer = Serialization.FindSerializerForType(payloadType, Configuration.DefaultSerializer);
66+
67+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
68+
var binary = Akka.Serialization.Serialization.WithTransport(Serialization.System, () => serializer.ToBinary(e.Payload));
69+
70+
return new SerializationResult(NpgsqlDbType.Bytea, binary, serializer);
6571
};
66-
_deserialize = (type, serialized, manifest, serializerId) =>
72+
_deserialize = (type, payload, manifest, serializerId) =>
6773
{
6874
if (serializerId.HasValue)
6975
{
70-
return Serialization.Deserialize((byte[])serialized, serializerId.Value, manifest);
76+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
77+
return Serialization.Deserialize((byte[])payload, serializerId.Value, manifest);
7178
}
7279
else
7380
{
7481
// Support old writes that did not set the serializer id
7582
var deserializer = Serialization.FindSerializerForType(type, Configuration.DefaultSerializer);
76-
return deserializer.FromBinary((byte[])serialized, type);
83+
84+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
85+
return Akka.Serialization.Serialization.WithTransport(Serialization.System, () => deserializer.FromBinary((byte[])payload, type));
7786
}
7887
};
7988
break;
@@ -110,7 +119,7 @@ protected override void WriteEvent(DbCommand command, IPersistentRepresentation
110119

111120
AddParameter(command, "@PersistenceId", DbType.String, e.PersistenceId);
112121
AddParameter(command, "@SequenceNr", DbType.Int64, e.SequenceNr);
113-
AddParameter(command, "@Timestamp", DbType.Int64, TimestampProvider.GenerateTimestamp(e));
122+
AddParameter(command, "@Timestamp", DbType.Int64, e.Timestamp);
114123
AddParameter(command, "@IsDeleted", DbType.Boolean, false);
115124
AddParameter(command, "@Manifest", DbType.String, manifest);
116125

@@ -125,6 +134,15 @@ protected override void WriteEvent(DbCommand command, IPersistentRepresentation
125134

126135
command.Parameters.Add(new NpgsqlParameter("@Payload", serializationResult.DbType) { Value = serializationResult.Payload });
127136

137+
if (serializer != null)
138+
{
139+
AddParameter(command, "@SerializerId", DbType.Int32, serializer.Identifier);
140+
}
141+
else
142+
{
143+
AddParameter(command, "@SerializerId", DbType.Int32, DBNull.Value);
144+
}
145+
128146
if (tags.Count != 0)
129147
{
130148
var tagBuilder = new StringBuilder(";", tags.Sum(x => x.Length) + tags.Count + 1);
@@ -138,17 +156,15 @@ protected override void WriteEvent(DbCommand command, IPersistentRepresentation
138156
else AddParameter(command, "@Tag", DbType.String, DBNull.Value);
139157
}
140158

159+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
141160
private static string QualifiedName(IPersistentRepresentation e)
142-
{
143-
var type = e.Payload.GetType();
144-
return type.TypeQualifiedName();
145-
}
161+
=> e.Payload.GetType().TypeQualifiedName();
146162

147163
protected override IPersistentRepresentation ReadEvent(DbDataReader reader)
148164
{
149165
var persistenceId = reader.GetString(PersistenceIdIndex);
150166
var sequenceNr = reader.GetInt64(SequenceNrIndex);
151-
//var timestamp = reader.GetDateTime(TimestampIndex);
167+
var timestamp = reader.GetInt64(TimestampIndex);
152168
var isDeleted = reader.GetBoolean(IsDeletedIndex);
153169
var manifest = reader.GetString(ManifestIndex);
154170
var raw = reader[PayloadIndex];
@@ -166,7 +182,7 @@ protected override IPersistentRepresentation ReadEvent(DbDataReader reader)
166182

167183
var deserialized = _deserialize(type, raw, manifest, serializerId);
168184

169-
return new Persistent(deserialized, sequenceNr, persistenceId, manifest, isDeleted, ActorRefs.NoSender, null);
185+
return new Persistent(deserialized, sequenceNr, persistenceId, manifest, isDeleted, ActorRefs.NoSender, null, timestamp);
170186
}
171187
}
172188

src/Akka.Persistence.PostgreSql/Snapshot/PostgreSqlQueryExecutor.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ WITH upsert AS (
6868
_serialize = ss =>
6969
{
7070
var serializer = Serialization.FindSerializerFor(ss);
71-
return new SerializationResult(NpgsqlDbType.Bytea, serializer.ToBinary(ss), serializer);
71+
// TODO: hack. Replace when https://github.com/akkadotnet/akka.net/issues/3811
72+
var binary = Akka.Serialization.Serialization
73+
.WithTransport(Serialization.System, () => serializer.ToBinary(ss));
74+
return new SerializationResult(NpgsqlDbType.Bytea, binary, serializer);
7275
};
7376
_deserialize = (type, serialized, manifest, serializerId) =>
7477
{
@@ -116,10 +119,10 @@ protected override void SetManifestParameters(object snapshot, DbCommand command
116119
var snapshotType = snapshot.GetType();
117120
var serializer = Serialization.FindSerializerForType(snapshotType, Configuration.DefaultSerializer);
118121

119-
string manifest = "";
120-
if (serializer is SerializerWithStringManifest)
122+
var manifest = "";
123+
if (serializer is SerializerWithStringManifest stringManifest)
121124
{
122-
manifest = ((SerializerWithStringManifest)serializer).Manifest(snapshot);
125+
manifest = stringManifest.Manifest(snapshot);
123126
}
124127
else if (!serializer.IncludeManifest)
125128
{

src/common.props

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,15 @@
1212
<NoWarn>$(NoWarn);CS1591</NoWarn>
1313
</PropertyGroup>
1414
<PropertyGroup>
15-
<XunitVersion>2.3.1</XunitVersion>
16-
<AkkaVersion>1.3.9</AkkaVersion>
15+
<XunitVersion>2.4.1</XunitVersion>
16+
<AkkaVersion>1.4.16</AkkaVersion>
1717
<PostgresVersion>3.2.5</PostgresVersion>
18+
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
1819
<NetFrameworkVersion>net45</NetFrameworkVersion>
1920
<TestSdkVersion>15.3.0</TestSdkVersion>
20-
<NetCoreTestVersion>netcoreapp1.1</NetCoreTestVersion>
21-
<NetFrameworkTestVersion>net452</NetFrameworkTestVersion>
22-
<NetStandardLibVersion>netstandard1.6</NetStandardLibVersion>
21+
<NetCoreTestVersion>netcoreapp3.1</NetCoreTestVersion>
22+
<NetFrameworkTestVersion>net471</NetFrameworkTestVersion>
2323
</PropertyGroup>
24-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
25-
<Reference Include="System.Data" />
26-
</ItemGroup>
27-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
28-
<PackageReference Include="System.Data.SqlClient">
29-
<Version>4.3.0</Version>
30-
</PackageReference>
31-
</ItemGroup>
32-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.1'">
33-
<PackageReference Include="System.Data.SqlClient">
34-
<Version>4.3.0</Version>
35-
</PackageReference>
36-
</ItemGroup>
3724
<PropertyGroup>
3825
<PackageReleaseNotes>Upgraded for Akka.NET v1.3.9.
3926
Other Fixes and Improvements**

0 commit comments

Comments
 (0)