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

copy in poc work #1

Merged
merged 34 commits into from
Jun 5, 2024
Merged

copy in poc work #1

merged 34 commits into from
Jun 5, 2024

Conversation

hahn-kev
Copy link
Collaborator

@hahn-kev hahn-kev commented May 7, 2024

No description provided.

src/Crdt.Sample/Changes/NewWordChange.cs Outdated Show resolved Hide resolved
src/Crdt.Sample/Models/Word.cs Show resolved Hide resolved
src/Crdt.Tests/ModelSnapshotTests.cs Show resolved Hide resolved
src/Crdt.Tests/SyncTests.cs Show resolved Hide resolved
src/Crdt/CrdtConfig.cs Show resolved Hide resolved
.idea/.idea.harmony.dir/.idea/.gitignore Outdated Show resolved Hide resolved
src/Crdt.Core/Crdt.Core.csproj Outdated Show resolved Hide resolved
src/Crdt.Core/HybridDateTime.cs Show resolved Hide resolved
src/Crdt.Core/ChangeEntity.cs Show resolved Hide resolved
src/Ycs/AssemblyAttributes.cs Outdated Show resolved Hide resolved
src/Crdt/CrdtKernel.cs Outdated Show resolved Hide resolved
src/Crdt/Db/CrdtDbContext.cs Show resolved Hide resolved
src/Crdt/Db/CrdtRepository.cs Outdated Show resolved Hide resolved
src/Crdt/Db/CrdtRepository.cs Outdated Show resolved Hide resolved
src/Crdt/Db/CrdtDbContext.cs Show resolved Hide resolved
src/Crdt/SnapshotWorker.cs Outdated Show resolved Hide resolved
src/Crdt/SyncHelper.cs Show resolved Hide resolved
src/Crdt/SyncHelper.cs Outdated Show resolved Hide resolved
src/Crdt/SyncHelper.cs Show resolved Hide resolved
src/Crdt/SyncHelper.cs Show resolved Hide resolved
Copy link
Contributor

@myieye myieye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've provided all the suggestions I have to offer at this point.

I still feel like this improvement (or preferably something better 😉) is worth doing.

All in all, this is very respectable, solid, clean, well-tested code.
Kudos x10! 🎉

Load testing is perhaps the one thing that could derail this Crdt magic.

refactor how commits get saved so the commit hash can be updated when processing snapshots. Change null parent hash to be `0000`
…changes to the same entity in a single commit. Also wrote some tests to ensure basic snapshot features are preserved.
…ctor some related code to simplify query when ignoreChangesAfter is null
src/Crdt.Core/CommitMetadata.cs Show resolved Hide resolved
src/Crdt.Core/CommitBase.cs Outdated Show resolved Hide resolved
src/Crdt.Linq2db/Crdt.Linq2db.csproj Outdated Show resolved Hide resolved
src/Crdt.Sample/Changes/SetWordTextChange.cs Outdated Show resolved Hide resolved
src/Crdt.Core/HybridDateTime.cs Outdated Show resolved Hide resolved
@hahn-kev
Copy link
Collaborator Author

@jasonleenaylor when you get a chance, I made the changes we talked about. CrdtRepository is now internal, and the DataModel tests now use a Mock time provider to specify the time used for commits. Other tests which are either testing sync issues with multiple commits being added at once, or tests at a lower level are just hard coding the date time on their own.

I've also created a ServerCommit class which lets me make CommitBase internal (at least the constructors meaning no-one can inherit from it), this class was previously in Lexbox.

@hahn-kev hahn-kev enabled auto-merge (squash) June 4, 2024 21:57
@hahn-kev hahn-kev merged commit f4ac121 into main Jun 5, 2024
@hahn-kev hahn-kev deleted the add-crdt branch June 5, 2024 13:35
@hahn-kev hahn-kev restored the add-crdt branch June 5, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants