Conversation
followup to #6951 we were getting these errors which it seems happens when there's a server error, and it's trying to set an error response code (e.g. 4xx/5xx): https://tldraw.sentry.io/issues/6965320409/events/97f5af83422748fc82dc345776874544/events/?environment=production-tldraw-multiplayer&project=4503966963662848&query=user.display%3A2a06%3A98c0%3A3600%3A%3A103&referrer=previous-event ### Change type - [ ] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [x] `other` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Wrap the response in `worker.ts` before calling `corsify` to prevent immutable headers errors while preserving `set-cookie` handling. > > - **Worker CORS handling** > - In `apps/dotcom/sync-worker/src/worker.ts` `after` hook, create a mutable `Response` (`new Response(response.body, response)`) and pass it to `corsify`. > - Continue manually restoring `set-cookie` headers on the final response. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d83e76d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
persistence_good wasn't triggering reliably ### Change type - [x] `other` <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Track persistence health state to emit `persistence_bad` on threshold and `persistence_good` after successful recovery. > > - **Sync worker (`TLDrawDurableObject.ts`)**: > - Add `persistenceBad` flag to track persistence health state across retries. > - In `persistToDatabase`: > - Set `persistenceBad = true` and broadcast `persistence_bad` when `attempt === PERSIST_RETRIES_NOTIFY_THRESHOLD`. > - After a successful persist, if `persistenceBad` is true, broadcast `persistence_good` and reset the flag. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 519d626. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )