Skip to content

Conversation

@LucDeCaf
Copy link
Contributor

@LucDeCaf LucDeCaf commented Dec 23, 2025

This PR replaces the implementations of GetHashCode and Equals for CrudEntry and SyncLocalDatabaseResult, which currently use JSONConvert.SerializeObject followed by a string comparison, with manual implementations relying on System.HashCode and some extra utility functions.

TODO:

  • Tests
  • Check if [JsonProperty] decorator is still needed on CrudEntry and SyncLocalDatabaseResult

@LucDeCaf LucDeCaf requested a review from Chriztiaan January 5, 2026 09:36
@LucDeCaf
Copy link
Contributor Author

LucDeCaf commented Jan 5, 2026

Update: When checking if we still need the JSON serialisation properties for SyncLocalDatabaseResult, it occurred to me that SyncLocalDatabaseResult isn't actually referenced anywhere, so I removed its definition, and lo and behold, all tests passing. Might be worth checking out.

Edit: There's actually a few classes in Powersync.Common/Client/Sync/Bucket which don't seem to be used. Probably was introduced by #21, since that had a lot of changes/removals.

@Chriztiaan
Copy link
Collaborator

Update: When checking if we still need the JSON serialisation properties for SyncLocalDatabaseResult, it occurred to me that SyncLocalDatabaseResult isn't actually referenced anywhere, so I removed its definition, and lo and behold, all tests passing. Might be worth checking out.

Edit: There's actually a few classes in Powersync.Common/Client/Sync/Bucket which don't seem to be used. Probably was introduced by #21, since that had a lot of changes/removals.

Noted. I think it would be good to drop whatever classes we no longer use, and if possible repurpose this PR to have a reference Equals/GetHashCode implementation.

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