Skip to content

Commit

Permalink
fix some lingering issues after updating
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Oct 15, 2024
1 parent 8b1237e commit 034c3dc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/SIL.Harmony.Sample/CrdtSampleKernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static IServiceCollection AddCrdtDataSample(this IServiceCollection servi
services.AddCrdtData<SampleDbContext>(config =>
{
config.EnableProjectedTables = true;
config.AddRemoteResourceEntity();
config.ChangeTypeListBuilder
.Add<NewWordChange>()
.Add<NewDefinitionChange>()
Expand Down
2 changes: 1 addition & 1 deletion src/SIL.Harmony/Changes/ChangeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ internal ChangeContext(Commit commit, SnapshotWorker worker, CrdtConfig crdtConf
}

public async ValueTask<bool> IsObjectDeleted(Guid entityId) => (await GetSnapshot(entityId))?.EntityIsDeleted ?? true;
internal IObjectBase Adapt(object obj) => _crdtConfig.ObjectTypeListBuilder.AdapterProvider.Adapt(obj);
internal IObjectBase Adapt(object obj) => _crdtConfig.ObjectTypeListBuilder.Adapt(obj);
}
1 change: 1 addition & 0 deletions src/SIL.Harmony/DataModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SIL.Harmony.Changes;
using SIL.Harmony.Db;
using SIL.Harmony.Entities;
using SIL.Harmony.Resource;

namespace SIL.Harmony;

Expand Down
1 change: 1 addition & 0 deletions src/SIL.Harmony/Db/CrdtRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using SIL.Harmony.Changes;
using SIL.Harmony.Entities;
using SIL.Harmony.Helpers;
using SIL.Harmony.Resource;

namespace SIL.Harmony.Db;

Expand Down
4 changes: 2 additions & 2 deletions src/SIL.Harmony/Resource/CreateRemoteResourceChange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace SIL.Harmony.Resource;
public class CreateRemoteResourceChange(Guid resourceId, string remoteId) : CreateChange<RemoteResource>(resourceId), IPolyType
{
public string RemoteId { get; set; } = remoteId;
public override ValueTask<IObjectBase> NewEntity(Commit commit, ChangeContext context)
public override ValueTask<RemoteResource> NewEntity(Commit commit, ChangeContext context)
{
return ValueTask.FromResult<IObjectBase>(new RemoteResource
return ValueTask.FromResult(new RemoteResource
{
Id = EntityId,
RemoteId = RemoteId
Expand Down
4 changes: 2 additions & 2 deletions src/SIL.Harmony/Resource/CreateRemoteResourcePendingUpload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public CreateRemoteResourcePendingUploadChange(Guid resourceId) : base(resourceI
{
}

public override ValueTask<IObjectBase> NewEntity(Commit commit, ChangeContext context)
public override ValueTask<RemoteResource> NewEntity(Commit commit, ChangeContext context)
{
return ValueTask.FromResult<IObjectBase>(new RemoteResource
return ValueTask.FromResult(new RemoteResource
{
Id = EntityId
});
Expand Down

0 comments on commit 034c3dc

Please sign in to comment.