Skip to content

[upstream #17164] useIsActiveItem spec flips back to false only after its assertion under load #385

Closed

Description

@berry-13

client/src/hooks/__tests__/useIsActiveItem.spec.tsx fails intermittently under load in reviewctl precheck jest-client runs, and passes every time in isolation.

Failing test: useIsActiveItem > flips isActive back to false when data-active-item is removed

expect(received).toBe(expected) // Object.is equality
Expected: "false"
Received: "true"
  > 83 |     expect(probe.getAttribute('data-active')).toBe('false');

Seen on LibreChat-AI#17158 (twice), LibreChat-AI#17164 (jest-client shard 1/4, 2026-10-16) and LibreChat-AI#17030. None of these PRs touch the hook or its spec; npx jest src/hooks/__tests__/useIsActiveItem.spec.tsx passes 3/3 on the same heads.

Likely cause: the test awaits one MutationObserver delivery (nextActiveItemMutation) and then asserts synchronously, so under CPU contention the hook's state update from the removal can land after the assertion. A fix would wait for the attribute (waitFor) or flush the observer callback inside act before asserting.

Activity

  1. added
    bugSomething isn't working
    readyreviewctl followups state
    area: clientreviewctl followups state
    in progressreviewctl followups state
    fixedreviewctl followups state
    and removed
    readyreviewctl followups state
    in progressreviewctl followups state
    on Oct 16, 2026
  2. berry-13 commented on Oct 17, 2026

    @berry-13
    OwnerAuthor

    Closed by reviewctl followups sync: LibreChat-AI#17199 merged on 2026-10-17 at 9f1fae7.

  3. berry-13 commented on Oct 17, 2026

    @berry-13
    OwnerAuthor

    Closed by reviewctl followups sync: LibreChat-AI#17199 merged on 2026-10-17 at 9f1fae7.

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

    area: clientreviewctl followups statebugSomething isn't workingfixedreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions