Repository navigation
Conversation
|
@Yungmon22 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
f8d7513 to
623fcde
Compare
|
Hi @Yungmon22, thanks for the PR. We can't merge it yet: our security scan found obfuscated malicious code in After the closing What to do before we can merge this PR
Thanks for your contribution, and sorry for the hassle. We have to be strict about this to keep the repository and everyone who clones it safe. |
Strips the payload this branch picked up (delete api.js, truncate eslint.config.js, unhook package.json). No functional change to the branch's own work.
|
@1nonlypiece — this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed 78aa1cd). |
Overview
This PR fixes the double-submit guard around fund-moving vault actions so that it no longer coalesces every concurrent call into the first in-flight promise. The guard is now keyed by its arguments: identical calls still share a single in-flight promise (true double-submit protection), while a concurrent call with a different key is rejected explicitly with a typed
ActionInFlightErrorinstead of silently resolving with another action's result. This prevents the UI from reporting success for a fund-moving action that was never sent.Related Issue
Changes
🔑 Argument-keyed single-flight runner
src/utils/singleFlight.tscreateSingleFlightRunner(runner, { key?, onConflict? })now accepts an optionalkeyfunction and anonConflictmode ('share' | 'reject').keyreturns a constant, so existing coalescing behaviour (e.g. dashboard loads) is unchanged.onConflict: 'reject'→ rejects immediately with a typedActionInFlightError; the underlying runner is not invoked for the conflicting call.🛡️ Vault action wiring
src/services/vaultService.tskey: (action, vaultId) => action + ':' + vaultIdandonConflict: 'reject'.submitVaultAction('cancel_vault', 'B')issued while('validate_milestone', 'A')is in flight now rejects and sends no request for B.isVaultActionPending(action?, vaultId?)reports per key.🖥️ UI error mapping
src/pages/VaultDetail.tsxActionInFlightErrorto "Another vault action is still processing. Please wait." and keeps the modal open instead of closing it and callingonChanged.🧪 Test fixture
e2e/fixtures/test.tsVerification Results
onConflict: 'reject'rejects withActionInFlightError; runner not invokedsubmitVaultAction('cancel_vault','B')during in-flight('validate_milestone','A')rejects and sends no request for Baction:vaultIdCloses #1508