From 43cdc0dced429b01ab971fc9081e34fd509e05ab Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Fri, 17 Jul 2026 21:36:09 -0300 Subject: [PATCH] fix(amm): pause hidden pool probes --- apps/amm/qml/state/NewPositionFlow.qml | 4 ++-- apps/amm/tests/qml/tst_LiquidityPage.qml | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/amm/qml/state/NewPositionFlow.qml b/apps/amm/qml/state/NewPositionFlow.qml index 93d313f..c7faae9 100644 --- a/apps/amm/qml/state/NewPositionFlow.qml +++ b/apps/amm/qml/state/NewPositionFlow.qml @@ -72,7 +72,7 @@ QtObject { property Timer poolPoller: Timer { interval: 5000 repeat: true - running: root.pendingPoolProbes.length > 0 + running: root.active && root.pendingPoolProbes.length > 0 onTriggered: root.pollPendingPool() } @@ -294,7 +294,7 @@ QtObject { function pollPendingPool() { if (root.poolProbeInFlight || root.pendingPoolProbes.length === 0 - || !root.backendReady) + || !root.backendReady || !root.active) return const pending = root.pendingPoolProbes[0] root.poolProbeInFlight = true diff --git a/apps/amm/tests/qml/tst_LiquidityPage.qml b/apps/amm/tests/qml/tst_LiquidityPage.qml index 3a0c581..4484d85 100644 --- a/apps/amm/tests/qml/tst_LiquidityPage.qml +++ b/apps/amm/tests/qml/tst_LiquidityPage.qml @@ -37,6 +37,7 @@ TestCase { }) property int contextRefreshCalls: 0 property int contextRequestId: 0 + property int quoteCalls: 0 property int submitCalls: 0 property var lastContextRefreshRequest: ({}) @@ -49,6 +50,7 @@ TestCase { } function requestNewPositionQuote(request, requestId, forceRefresh) { + ++quoteCalls var result = JSON.parse(JSON.stringify(quoteResult || ({}))) result.requestId = requestId newPositionQuoteResult = result @@ -206,7 +208,16 @@ TestCase { compare(page.flow.pendingPoolProbes.length, 1) compare(backend.contextRefreshCalls, 0) + compare(backend.quoteCalls, 0) verify(page.flow.selectedPoolCreationPending()) + + page.flow.pollPendingPool() + compare(backend.quoteCalls, 0) + + page.flow.active = true + wait(0) + page.flow.pollPendingPool() + compare(backend.quoteCalls, 1) } function test_activePoolSubmissionDoesNotStartPoolCreationProbe() {