fix(studio): save retries, mutation queue circuit breaker, save_failure diagnostics#1366
Open
miguel-heygen wants to merge 1 commit into
Open
fix(studio): save retries, mutation queue circuit breaker, save_failure diagnostics#1366miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
…re diagnostics Save failures could silently drop user work: code-editor saves fired a single PUT with no retry, DOM-edit failures drained the whole queue against a failing server, and several failure paths only logged to the console. - Retry code-editor saves with exponential backoff instead of dropping the edit on the first failed PUT. - Circuit breaker on the DOM-edit save queue: a failing server pauses the queue with a user-visible error state instead of burning every queued mutation against it. - save_failure events now carry error_message, status_code, and source on every emission path; style/attribute DOM-edit failures that previously only logged to the console now emit telemetry too. - Route unawaited commitMutation call sites (GSAP drag, property scrubbing, undo/redo, text fields) through a safe wrapper that reports failures via telemetry instead of unhandledrejection. Follow-ups (deferred): version/ETag conflict guard on file PUTs, offline save queue.
Fallow audit reportFound 49 findings. Dead code (6)
Duplication (22)
Health (21)
Generated by fallow. |
Comment on lines
+127
to
+132
| const response = await fetch(`/api/projects/${pid}/files/${encodeURIComponent(path)}`, { | ||
| method: "PUT", | ||
| headers: { "Content-Type": "text/plain" }, | ||
| body: content, | ||
| signal: controller.signal, | ||
| }); |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Studio save failures can silently drop user work:
commitMutationcall sites (GSAP drag, property scrubbing, undo/redo, text fields) are unawaited, surfacing as unhandled promise rejections instead of reported errors.Fix
useFileManager).utils/domEditSaveQueue.ts): repeated failures pause persistence and show a dismissible alert instead of draining the queue.save_failuretelemetry now carrieserror_message,status_code, andsourceon every emission path (utils/studioSaveDiagnostics.ts); style/attribute failures emit telemetry instead of only console-warning.useSafeGsapCommitMutation) routes unawaited commit failures through telemetry + a user-facing toast rather thanunhandledrejection.Follow-ups (deferred to keep this reviewable)
Testing
bun run buildgreen, oxlint/oxfmt clean.