More screenshots

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    Repair Request Cancellation & Abort Bugs

    1

    Diagnose and repair request cancellation, abort propagation, timeouts, background continuation, cleanup, and partial side effects.

    $8.99

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    0 installsSecurity scanned
    Repair Request Cancellation & Abort Bugs

    Repair Request Cancellation & Abort Bugs

    Example session with this skill installed

    The 'submit-order' endpoint keeps processing payments even after the client disconnects. Here is the Node.js handler snippet and the logs showing 499 errors followed by successful DB writes.

    • Read your context and instructions
    • Compiled the repair request cancellation

    I have analyzed the submit-order handler and the provided logs. The issue stems from the payment gateway call not being linked to the incoming request's AbortSignal, allowing the transaction to complete despite the client's 499 disconnect.

    Diagnosis and Repair

    The handler currently awaits the processPayment promise without passing the request context. While the database transaction is scoped, it is not aborted when the connection closes.

    ComponentCurrent BehaviorRequired Invariant
    ClientDisconnects (499)Signal must propagate to all downstream IO
    Payment APIRuns to completionMust abort via AbortController signal
    DB TransactionCommits regardless of statusRollback must trigger on signal abort

    Implementation Patch

    // routes/orders.js - Proposed Fix
    app.post('/submit-order', async (req, res) => {
      const ac = new AbortController();
      req.on('close', () => ac.abort());
    
      const session = await db.startSession();
      try {
        session.startTransaction();
    
        // Link external payment call to request cancellation
        const payment = await paymentGateway.process({
          amount: req.body.total,
          signal: ac.signal 
        });
    
        // Ensure DB write respects the signal
        await Order.create([{ ...req.body, paymentId: payment.id }], { 
          session,
          signal: ac.signal 
        });
    
        await session.commitTransaction();
        res.status(201).json({ success: true });
      } catch (err) {
        await session.abortTransaction();
        if (err.name === 'AbortError') {
          console.log('Request cancelled: cleanup successful');
        } else {
          throw err;
        }
      } finally {
        session.endSession();
      }
    });
    

    Deterministic Test Plan

    1. Mock Service: Create a mock payment gateway with a 500ms latency.
    2. Abort Trigger: Use a setTimeout to trigger req.emit('close') at 200ms.

    Assertion: Verify that the paymentGateway receives an abort signal and that Order.countDocuments() remains 0.

    Next steps

    1. Update the paymentGateway SDK wrapper to accept an AbortSignal.
    2. Deploy the patch to a staging environment and verify log suppression for cancelled requests.
    3. Check for similar patterns in the 'refund-process' endpoint.

    Connects securely to your tools. The creator never sees your data.

    What you get

    Propagate AbortSignals through downstream API calls and DB queries.Identify and fix orphaned background processes after client disconnects.Prevent partial data writes during request timeouts or 499 errors.Design deterministic tests for concurrency and race condition bugs.

    About this skill

    Repair Request Cancellation & Abort Bugs is a bounded ToolForge Labs workflow. Diagnose and repair request cancellation, abort propagation, timeouts, background continuation, cleanup, and partial side effects. Works from full repositories or partial context such as snippets, logs, configuration, traces, and architecture notes. Produces concrete repairs or evidence-backed review outputs while preserving existing product/security policy.

    It works from a full repository or partial evidence such as snippets, logs, configuration, traces, tickets, and architecture notes. The skill preserves existing product and security policy, separates verified facts from assumptions, avoids invented execution claims, and produces concrete repair or review steps with focused deterministic validation or traceable evidence.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 20 days ago

    • Passed all security checks, Safe to install

    Listed20 days ago

    What's inside

    Frequently Asked Questions