Sync reset#1280
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements server-side support for syncing puzzle resets between clients. The changes enable the system to handle reset events by creating special reset entries in the database and ensuring proper synchronization of reset state across connected clients.
- Adds support for puzzle reset synchronization with new reset entry types
- Implements filtering logic to prevent stale data from appearing after resets
- Updates JavaScript communication to handle reset events between client and server
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| PuzzleItemProperty.cs | Adds IsReset property and CreateReset factory method for reset entries |
| ClientSyncComponent.razor.cs | Implements reset handling logic and filters stale data during sync |
| ClientSyncComponent.razor | Adds JavaScript functions for reset event communication |
| JsPuzzleChange.cs | Defines JsPuzzleReset class for reset data transfer |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| // If this is a reset, we need to send a reset message to the JS side | ||
| await JSRuntime.InvokeVoidAsync("onPuzzleResetSynced", new JsPuzzleReset() | ||
| { | ||
| puzzleIds = new[] { Encoding.UTF8.GetString(Base64UrlTextEncoder.Decode(entry.SubPuzzleId)) }, |
There was a problem hiding this comment.
Why not build a list of IDs and send them all at once
|
I'm a bit confused - I got mail about these commits this evening, but the PR above says they were added 2 months ago. Which is accurate? |
|
Now it shows 2 commits instead of 3 and says the commits were added 2 hours ago instead of 2 months ago. I swear this isn't what I saw just a few minutes ago - now I have a new set of questions lol... |
This is the server side of syncing resets. It also requires changes in puzzleSync.js. Fixes #1245