fix(migrations): show retry failure over stale precheck error in PrecheckPanel - #14313
Closed
detail-app[bot] wants to merge 1 commit into
Closed
detail-app[bot] wants to merge 1 commit into
detail-app[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Detail bug report: View on Detail
Summary
Related Issue: polarsource/feedback#485
On the merchant-migration
source_setupstep,PrecheckPanelshowed the stale prior-run error instead of a just-failed retry's own failure message. The fix reorders the error derivation so the newest failure wins.What
PrecheckPanel.tsx: theerrorternary now checksprecheck.isErrorfirst, then the cachedoperation.error(with a new generic fallback for a failed operation lacking an error string), thennull.PrecheckPanel.test.tsx(new): the first component-test harness for this panel, covering the ordering invariant and the sticky-error-clearing behavior.Why
A failed retry POST does not overwrite the cached
migration.operation— theuseRunMerchantMigrationPrecheckmutation only writes query data inonSuccess. So when a prior worker precheck leftoperation.status === 'failed'with a non-emptyoperation.error, the old derivation(failed ? operation.error : null) || (precheck.isError ? retryMsg : null)short-circuited on the cached value, and theprecheck.isErrorbranch was dead. After a failed retry the merchant saw the same stale "We couldn't verify the Stripe key right now…" text instead of "We couldn't start the pre-check. Please try again." — an attribution gap (the corrective action is identical either way). Introduced when PR #14253 rewrote the panel from sync to async polling.How
One-line operand reorder so the newest failure takes precedence, mirroring the sibling
ReviewTable's ordering. Added a generic fallback ("We couldn't run the pre-check. Please try again.") for the defensive case where a failed operation has no error string. No new imports, types, or behavioral contracts.Testing
PrecheckPanelcomponent suite (6 tests): mocksapi.POSTto drive the realuseRunMerchantMigrationPrecheckmutation through a realQueryClient(shared with the mockedgetQueryClientsoonSuccesscache writes are observable) and stubs Orbit components. Covers: stale error shown when idle, retry failure wins over stale (the bug), retry failure with no prior run, failed-without-error fallback, in-flight spinner/disabled state, and no-sticky-error after a successful retry.tsc --noEmit, type-awareoxlint, andoxfmt --checkon the changed files.dev dockerstack couldn't initialize — the host filesystem (a 20GB loop device) was 100% full, so the per-instance Postgres database and MinIO buckets couldn't be created (No space left on deviceduringCREATE DATABASE/ MinIO setup). The behavior it would verify (the rendered error-text swap) is otherwise covered by the real-mutation component suite above.Checklist
Automatic Fixes PRs can be configured here.