Skip to content

'CREATE EXTERNAL SUBNET' text disappears for good after clicking multiple times on the Subnet pool dropdown #3340

Closed

Description

@paudmir

What happened

While using the bombadil fuzzer, I noticed that the text on the CREATE EXTERNAL SUBNET button disappeared after clicking multiple times on the Subnet pool dropdown menu.
I was able to reproduce this by focusing on that element, and then hitting Enter and Arrow down (or up) to keep the focus on it and open/close it. It might have been an combo of hitting Enter on the button itself (which reloads the text after validating the fields?)

Easier to check on the video:

20260821-0642-56.9693319.mp4

Browser console output

Nothing in console

Console version

https://github.com/oxidecomputer/console/commits/abbe25e8afab12062f61cb25c2556061ed5a2130

What system are you on?

dogfood

System version

22.0.0-0.ci+git09a94cd462c

Activity

  1. added theissue type on Aug 21, 2026
  2. david-crespo commented on Aug 21, 2026

    @david-crespo
    Collaborator

    That's very cool. I think the form is being submitted and it's going very briefly into the loading state (which changes the button text to a spinner) but it's too fast to actually land on the spinner, so you just get the first half of the animation before it ends. If that's right, the most likely solution would be to either not change the button state until after fast local validation completes or, if that's hard, hack it by putting a timer on the animation so it doesn't start until it's been in the loading state for like 50 ms.

    Edit: oh, haha. I didn't watch the entire video. It permanently disappears if you do it enough times. That's awesome.

  3. david-crespo commented on Aug 21, 2026

    @david-crespo
    Collaborator

    Got a script from codex that can repro it. With npm run dev running, run this in another terminal:

    node .claude/notes/reproduce-loading-button-race.mjs 1 0 verbose

    Arguments are iterations, delayMs, and optional verbose. It runs headless and saves a screenshot under .claude/notes/.

    repro script
    import { chromium } from 'playwright'
    
    const url = 'http://127.0.0.1:4000/projects/mock-project/external-subnets-new'
    const iterations = Number(process.argv[2] ?? 25)
    const delayMs = Number(process.argv[3] ?? 0)
    const verbose = process.argv[4] === 'verbose'
    
    const browser = await chromium.launch()
    const page = await browser.newPage()
    
    await page.goto(url, { waitUntil: 'domcontentloaded' })
    const dialog = page.getByRole('dialog')
    await dialog.getByRole('heading', { name: /Create external subnet/ }).waitFor()
    
    const submit = dialog.locator('button[type="submit"]')
    const pool = dialog.getByRole('button', { name: 'Subnet pool' })
    
    await submit.evaluate((button) => {
      window.buttonRaceDiagnostics = { keys: [], clicks: [], submits: [], mutations: [] }
      for (const type of ['keydown', 'keypress', 'keyup']) {
        document.addEventListener(
          type,
          (event) => {
          const entry = {
            time: performance.now(),
            type,
            key: event.key,
            target: event.target?.outerHTML,
            defaultPrevented: event.defaultPrevented,
          }
          window.buttonRaceDiagnostics.keys.push(entry)
          setTimeout(() => {
            entry.defaultPrevented = event.defaultPrevented
          }, 0)
          },
          true
        )
      }
      document.addEventListener(
        'click',
        (event) => {
          window.buttonRaceDiagnostics.clicks.push({
            time: performance.now(),
            target: event.target?.outerHTML,
          })
        },
        true
      )
      document.addEventListener(
        'submit',
        (event) => {
          const entry = {
            time: performance.now(),
            defaultPrevented: event.defaultPrevented,
            activeElement: document.activeElement?.outerHTML,
          }
          window.buttonRaceDiagnostics.submits.push(entry)
          setTimeout(() => {
            entry.defaultPrevented = event.defaultPrevented
          }, 0)
        },
        true
      )
      new MutationObserver(() => {
        const label = button.querySelector(':scope > span:last-child')
        const labelStyle = label && getComputedStyle(label)
        window.buttonRaceDiagnostics.mutations.push({
          time: performance.now(),
          ariaDisabled: button.getAttribute('aria-disabled'),
          labelStyle: label?.getAttribute('style'),
          labelOpacity: labelStyle?.opacity,
          labelTransform: labelStyle?.transform,
          spinnerCount: button.querySelectorAll('[aria-label="Spinner"]').length,
        })
      }).observe(button, { attributes: true, childList: true, subtree: true })
    })
    
    async function buttonState(label) {
      const state = await submit.evaluate((button) => {
        const label = button.querySelector(':scope > span:last-child')
        const spinner = button.querySelector('[aria-label="Spinner"]')
        const style = label && getComputedStyle(label)
        return {
          activeElement: document.activeElement === button ? 'submit' : document.activeElement?.outerHTML,
          ariaDisabled: button.getAttribute('aria-disabled'),
          buttonText: button.textContent,
          labelOpacity: style?.opacity,
          labelTransform: style?.transform,
          spinnerCount: button.querySelectorAll('[aria-label="Spinner"]').length,
          spinnerOpacity: spinner ? getComputedStyle(spinner.parentElement).opacity : null,
          html: button.innerHTML,
        }
      })
      if (verbose) console.log(label, JSON.stringify(state))
      return state
    }
    
    if (verbose) console.log('pool element', await pool.evaluate((button) => button.outerHTML))
    const initialState = await buttonState('initial')
    
    await pool.focus()
    for (let i = 0; i < iterations; i++) {
      await page.keyboard.press('Enter')
      await page.waitForTimeout(delayMs)
      await page.keyboard.press(i % 2 ? 'ArrowDown' : 'ArrowUp')
      await page.waitForTimeout(delayMs)
    }
    await page.waitForTimeout(500)
    const finalState = await buttonState('settled after pool Enter/Arrow fuzzing')
    
    const diagnostics = await page.evaluate(() => window.buttonRaceDiagnostics)
    const blankMutations = diagnostics.mutations.filter(
      (mutation) => mutation.spinnerCount === 0 && Number(mutation.labelOpacity) < 0.1
    )
    const stateTransitions = diagnostics.mutations.filter(
      (mutation, index, mutations) =>
        index === 0 ||
        mutation.ariaDisabled !== mutations[index - 1].ariaDisabled ||
        mutation.spinnerCount !== mutations[index - 1].spinnerCount
    )
    const summary = {
      iterations,
      delayMs,
      initialState,
      finalState,
      diagnostics: verbose
        ? {
        keys: diagnostics.keys
          .slice(0, 20)
          .map(({ type, key, target, defaultPrevented }, index) => ({
            index,
            type,
            key,
            target: target?.match(/<(button|div)[^>]*/)?.[0],
            defaultPrevented,
          })),
        keyCount: diagnostics.keys.length,
        clicks: diagnostics.clicks.slice(0, 10),
        submits: diagnostics.submits.slice(0, 5),
        submitCount: diagnostics.submits.length,
        mutationCount: diagnostics.mutations.length,
        blankMutationCount: blankMutations.length,
        blankMutations: blankMutations.slice(0, 10),
        stateTransitions,
            mutations: diagnostics.mutations.slice(-30),
          }
        : {
            keyCount: diagnostics.keys.length,
            submitCount: diagnostics.submits.length,
            mutationCount: diagnostics.mutations.length,
            blankMutationCount: blankMutations.length,
            stateTransitions,
          },
    }
    
    console.log('RESULT', JSON.stringify(summary))
    
    if (verbose) {
      console.log(await dialog.ariaSnapshot())
      for (const message of await page.consoleMessages()) {
        console.log(`[console:${message.type()}] ${message.text()}`)
      }
      for (const error of await page.pageErrors()) {
        console.log(`[pageerror] ${error.message}`)
      }
    }
    
    await page.screenshot({ path: '.claude/notes/loading-button-race.png' })
    await browser.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions