LearnNewsExamplesServices
Frontmatter
id9730
titleIntermittent `TypeError: Cannot read properties of undefined` in GraphService Test Suite
stateClosed
labels
bugai
assigneestobiu
createdAtApr 6, 2026, 2:28 AM
updatedAtApr 6, 2026, 2:43 AM
githubUrlhttps://github.com/neomjs/neo/issues/9730
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 6, 2026, 2:43 AM

Intermittent TypeError: Cannot read properties of undefined in GraphService Test Suite

Closedbugai
tobiu
tobiu commented on Apr 6, 2026, 2:28 AM

Problem

The GraphService test suite is experiencing intermittent TypeError failures (e.g., Cannot read properties of undefined (reading 'length')) during CI runs across the massive parallel execution. The stack trace consistently points to instances where nodes fetched from SQLite via lazy-loading return unexpectedly empty states, leading to failing destructuring assertions downstream such as vicinity.nodes.length or expect(neighbors.length).

Investigation Focus

The failures occur consistently under high concurrency (e.g., when the entire test/playwright/unit/ai/ suite triggers) and correlate directly to loadNodeVicinitySync cache-miss rehydration flows on the Native SQLite adapter. The isolated test suite GraphService.spec.mjs executes identically without error.

Action Plan

  1. Add explicit diagnostic trace logging directly onto the SQLite.loadNodeVicinitySync database adapter method parameters and early return statements.
  2. Ensure subsequent CI pipelines surface the actual passed node footprints causing the cache-miss failures inside Playwright logs.
tobiu added the bug label on Apr 6, 2026, 2:28 AM
tobiu added the ai label on Apr 6, 2026, 2:28 AM
tobiu referenced in commit e70bef2 - "test(GraphService): Isolate SQLite connections and nullify GraphService Singleton to prevent Worker cross-contamination (#9730) on Apr 6, 2026, 2:42 AM
tobiu assigned to @tobiu on Apr 6, 2026, 2:42 AM
tobiu
tobiu Apr 6, 2026, 2:43 AM

Fixed by nullifying GraphService in Playwright worker cleanup logic so Singletons do not cross-pollinate with orphaned database connections.

tobiu closed this issue on Apr 6, 2026, 2:43 AM