TT-7583 fix: write the remote artifact type id into phrase BT step settings - #501
TT-7583 fix: write the remote artifact type id into phrase BT step settings#501nabalone wants to merge 5 commits into
Conversation
…eted A failed upload item told its callback nothing but success: false, so both itemComplete handlers responded to every failure by calling setOrbitRetries -- raising a "possible network issue" retry banner for a file we rejected locally or a 4xx the server deliberately returned. Give the callback a reason instead. UploadFailureReason names why the item failed (unsupported type, too big, local write, 4xx, 5xx, timeout, no response); suggestsConnectionProblem is the single place that decides which of those is evidence about the user's connection, and only a request that never completed qualifies. A status number alone could not carry this: local rejections never reach the network and have no status, and undefined already means "no response" to isRetryableUploadStatus. This narrows the warning: 5xx and 429 no longer raise it, since both mean we reached the server. Retry policy is unchanged -- isRetryableUploadStatus still governs the retry loop, and is now separate from the connectivity question. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ttings PhraseBackTranslateStepSettings seeded its artifact type from getTypeId, which returns the local Orbit record id. That value was emitted into the step settings JSON and persisted verbatim, but every reader decodes settings.artifactTypeId with remoteIdGuid (and SelectArtifactType hands the other step-settings dialogs remote ids). The `?? id` fallback in those readers hid it locally; once the step synced, peers could not resolve the GUID. Translate the local id to its remote id when seeding, keeping the local id when there is no mapping (offline-only artifact types have no remote id). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…er completed" This reverts commit a05f6b1.
c53837d to
ba9802d
Compare
| // Step settings store the *remote* artifact type id (every reader decodes with | ||
| // remoteIdGuid, and SelectArtifactType hands the other step-settings dialogs | ||
| // remote ids), so translate the local id getTypeId returns. Offline-only types | ||
| // have no remote id — keep the local id there — TT-7583. | ||
| const [artifactTypeId, setArtifactTypeId] = useState<string>(() => { | ||
| const localId = getTypeId(ArtifactTypeSlug.PhraseBackTranslation) ?? ''; | ||
| if (!localId) return ''; |
There was a problem hiding this comment.
Seed always uses the Phrase BT slug even for a Retell BT preset
The seed is hard-coded to ArtifactTypeSlug.PhraseBackTranslation, while the comment says the artifact type is fixed by the workflow step preset (Phrase BT vs Retell BT). For a brand-new Retell BT step with empty settings, the dialog will write the Phrase BT artifact type. This is pre-existing behavior (the same hard-coded slug existed before), but the remote-id translation now makes that seeded value durable across peers, so it is worth confirming Retell BT steps always arrive with settings already populated.
There was a problem hiding this comment.
Devin left this comment. Can someone confirm whether this preexisting behavior is intentional?
…cases - useWavesurferRegions: a too-short first gap indexed result[-1] and threw; skip it so the gap joins the next region instead. - useWavesurferRegions: don't drop the only region when the whole clip is shorter than the minimum length. - useGuidedPhraseSegments: note the remaining case where auto-segment legitimately yields nothing and the bootstrap poll keeps spinning. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…autosave-hardening # Conflicts: # src/renderer/src/crud/useWavesurferRegions.tsx
Summary
TT-7583 — PBT Auto Save fails in the Desktop Application.
1. Write the remote artifact type id into phrase BT step settings.
PhraseBackTranslateStepSettingsseeded its artifact type fromgetTypeId, whichreturns the local Orbit record id. That value was emitted into the step settings JSON
and persisted verbatim, but every reader decodes
settings.artifactTypeIdwithremoteIdGuid(andSelectArtifactTypehands the other step-settings dialogs remoteids). The
?? idfallback in those readers hid it locally; once the step synced,peers could not resolve the GUID.
Now the local id is translated to its remote id when seeding, keeping the local id
when there is no mapping (offline-only artifact types have no remote id).
2. Guard auto-segmentation against two crash paths.
Both are throws hit while auto-segmenting a passage on the way into phrase back
translation, and both are behavior-preserving apart from the crash:
mergeVersesabsorbed a too-short gap into the previous region, but the firstgap has no previous region —
result[result.length - 1].endthrew onundefined.It now skips that fixup when
resultis empty, leavingstartput so the shortleading gap folds into the next region (the same outcome as the existing
fromVerses(start)skip path).extractRegionsspliced away a too-short trailing region unconditionally, so aclip shorter than
minRegionLenSecondswas left with an empty array and then threwon
sRegions[sRegions.length - 1]. It now only drops the trailing region when morethan one remains, keeping the single segment for a very short clip.
A comment in
useGuidedPhraseSegmentsalso records a related case that is notfixed here: auto-segment can legitimately yield nothing, and returning
falseleavesthe 250 ms bootstrap poll in
PassageDetailGuidedPhraseRecordspinning. Left as anote rather than a behavior change.
Files touched
src/renderer/src/components/StepEditor/PhraseBackTranslateStepSettings.tsx— seed with the remote artifact type idsrc/renderer/src/components/StepEditor/PhraseBackTranslateStepSettings.test.tsx— coverage for the translationsrc/renderer/src/crud/useWavesurferRegions.tsx— the two auto-segmentation crash guardssrc/renderer/src/components/PassageDetail/carefulSpeech/useGuidedPhraseSegments.ts— comment only, no behavior changeTest plan
PhraseBackTranslateStepSettings.test.tsxcovers the id translation and theoffline-only fallback.
artifactTypeIdis theremote GUID.
length, and audio whose whole clip is shorter than the minimum — neither should
throw; the short clip keeps one segment.
Notes
TT-7583 fix: only warn of a network issue when the upload never completedand its revert, so those two cancel out and contribute no netdiff. That work (
UploadFailureReason/suggestsConnectionProblem) is not part ofthis PR's behavior — it can be dropped from history or reland separately.
develop; the earlier duplicate ofRetry rejected phrase save on reconnect(already merged as fix: retry rejected phrase save on reconnect #499) was dropped by the rebase.🤖 Generated with Claude Code