Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,29 @@
},
{
$type: Commit,
Snapshots: [
{
$type: ObjectSnapshot,
Id: Guid_5,
TypeName: Word,
Entity: {
$type: Word,
Text: first,
Note: a word note,
Id: Guid_2
},
EntityId: Guid_2,
EntityIsDeleted: false,
CommitId: Guid_6,
IsRoot: false
}
],
Hash: Hash_2,
ParentHash: Hash_1,
ChangeEntities: [
{
$type: ChangeEntity<IChange>,
CommitId: Guid_5,
CommitId: Guid_6,
EntityId: Guid_2,
Change: {
$type: SetWordNoteChange,
Expand All @@ -68,9 +85,9 @@
CompareKey: {
$type: ValueTuple<DateTimeOffset, long,
Item1: DateTimeOffset_2,
Item3: Guid_5
Item3: Guid_6
},
Id: Guid_5,
Id: Guid_6,
HybridDateTime: {
$type: HybridDateTime,
DateTime: DateTimeOffset_2
Expand All @@ -88,7 +105,7 @@
ChangeEntities: [
{
$type: ChangeEntity<IChange>,
CommitId: Guid_6,
CommitId: Guid_7,
EntityId: Guid_2,
Change: {
$type: SetWordTextChange,
Expand All @@ -101,9 +118,9 @@
CompareKey: {
$type: ValueTuple<DateTimeOffset, long,
Item1: DateTimeOffset_3,
Item3: Guid_6
Item3: Guid_7
},
Id: Guid_6,
Id: Guid_7,
HybridDateTime: {
$type: HybridDateTime,
DateTime: DateTimeOffset_3
Expand All @@ -119,7 +136,7 @@
Snapshots: [
{
$type: ObjectSnapshot,
Id: Guid_7,
Id: Guid_8,
TypeName: Word,
Entity: {
$type: Word,
Expand All @@ -129,7 +146,7 @@
},
EntityId: Guid_2,
EntityIsDeleted: false,
CommitId: Guid_8,
CommitId: Guid_9,
IsRoot: false
}
],
Expand All @@ -138,7 +155,7 @@
ChangeEntities: [
{
$type: ChangeEntity<IChange>,
CommitId: Guid_8,
CommitId: Guid_9,
EntityId: Guid_2,
Change: {
$type: SetWordTextChange,
Expand All @@ -151,9 +168,9 @@
CompareKey: {
$type: ValueTuple<DateTimeOffset, long,
Item1: DateTimeOffset_4,
Item3: Guid_8
Item3: Guid_9
},
Id: Guid_8,
Id: Guid_9,
HybridDateTime: {
$type: HybridDateTime,
DateTime: DateTimeOffset_4
Expand Down
8 changes: 4 additions & 4 deletions src/SIL.Harmony/SnapshotWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ private void AddSnapshot(ObjectSnapshot snapshot)
private bool IsNew(ObjectSnapshot snapshot)
{
var entityId = snapshot.EntityId;
if (_rootSnapshots.TryGetValue(entityId, out var rootSnapshot))
if (_pendingSnapshots.TryGetValue(entityId, out var pendingSnapshot))
{
return rootSnapshot.Id != snapshot.Id;
return pendingSnapshot.Id == snapshot.Id;
}
if (_pendingSnapshots.TryGetValue(entityId, out var pendingSnapshot))
if (_rootSnapshots.TryGetValue(entityId, out var rootSnapshot))
{
return pendingSnapshot.Id != snapshot.Id;
return rootSnapshot.Id == snapshot.Id;
}
return false;
}
Expand Down