diff --git a/apps/amm/qml/components/liquidity/NewPositionForm.qml b/apps/amm/qml/components/liquidity/NewPositionForm.qml index 0cad382..3f820e7 100644 --- a/apps/amm/qml/components/liquidity/NewPositionForm.qml +++ b/apps/amm/qml/components/liquidity/NewPositionForm.qml @@ -1432,11 +1432,15 @@ AmmActionCard { if (root.poolFeeBps > 0 && root.selectedFeeBps !== root.poolFeeBps) { root.selectedFeeBps = root.poolFeeBps root.localErrors = [] - root.quoteRequested(true, { + var retry = { "ok": true, "errors": [], "request": root.poolProbeRequest(root.pairRequest()) - }) + } + retry.poolDiscoveryProbe = root.activePool + && root.amountA.length === 0 + && root.amountB.length === 0 + root.quoteRequested(true, retry) return } diff --git a/apps/amm/tests/qml/tst_NewPositionForm.qml b/apps/amm/tests/qml/tst_NewPositionForm.qml index a592a80..5842ef3 100644 --- a/apps/amm/tests/qml/tst_NewPositionForm.qml +++ b/apps/amm/tests/qml/tst_NewPositionForm.qml @@ -473,6 +473,31 @@ TestCase { compare(form.localErrors.length, 0) } + function test_feeTierCorrectionKeepsEmptyDraftProbeNonSubmittable() { + var form = createForm() + quoteRequestedSpy.target = form + quoteRequestedSpy.clear() + + form.flowState = flowState({ + "schema": "new-position.v2", + "status": "error", + "code": "fee_tier_mismatch", + "tokenAId": tokenHigh, + "tokenBId": tokenLow, + "poolStatus": "active_pool", + "poolFeeBps": 5, + "errors": [{ + "code": "fee_tier_mismatch", + "details": { "poolFeeBps": 5 } + }] + }) + + tryCompare(quoteRequestedSpy, "count", 1) + var retry = quoteRequestedSpy.signalArguments[0][1] + compare(retry.request.feeBps, 5) + compare(retry.poolDiscoveryProbe, true) + } + function test_submissionSnapshotCarriesPoolAccountForProbe() { var form = createForm() form.flowState = flowState({