fix(amm): pause hidden pool probes

This commit is contained in:
Ricardo Guilherme Schmidt 2026-07-17 21:36:09 -03:00
parent d51856a34f
commit 43cdc0dced
No known key found for this signature in database
GPG Key ID: 1396EA17DE132FFE
2 changed files with 13 additions and 2 deletions

View File

@ -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

View File

@ -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() {