Skip to content

--eager with a live Bolt push silently drops every type node and its containment edges #178

Description

@rahlk

Problem

--emit neo4j --neo4j-uri … --eager pushes a graph with no type nodes at all. Without --eager, the same command on the same project pushes them correctly. The run exits 0 either way and reports nothing.

The result is a graph that looks populated — modules and callables are all there — but has no :TSClass, :TSInterface, :TSEnum, :TSTypeAlias or :TSNamespace, and therefore no TS_HAS_METHOD, TS_HAS_FIELD, TS_EXTENDS or TS_IMPLEMENTS. A consumer that requires those relationship types refuses the graph at attach; one that does not will quietly see an application with no classes.

Repro

codeanalyzer-typescript 1.3.0 from PyPI, against any project with a class, pushed to an empty Neo4j:

cants -i <project> --emit neo4j --neo4j-uri bolt://localhost:7687 \
      --neo4j-user neo4j --neo4j-password <pw> --app-name probe-plain
cants -i <project> --emit neo4j --neo4j-uri bolt://localhost:7687 \
      --neo4j-user neo4j --neo4j-password <pw> --app-name probe-eager --eager

then, per application:

MATCH (n) WHERE n.id STARTS WITH 'can://typescript/<app>/'
UNWIND labels(n) AS l RETURN l, count(*) ORDER BY l

Measured on a five-file sample app:

flags result
no --eager TSCallable 35, TSClass 6, TSEnum 2, TSInterface 2, TSModule 5, TSNamespace 1, TSTypeAlias 1
--eager TSCallable 35, TSModule 5 — and nothing else

Callables and modules are unaffected in both.

Not the file projection

The same run's graph.cypher carries every type node and applies cleanly, so the projection itself is right and only the live push loses them. Writing the emitted graph.cypher by hand is a usable workaround, which is what we have done in our test harness for now.

Why it took a while to see

A push without --eager is correct, so this only appears when a caller asks for a clean rebuild — which a test harness or a CI job is exactly the sort of caller to do.

Environment

codeanalyzer-typescript 1.3.0 (PyPI wheel), Neo4j 5, macOS. Happy to supply the sample project if useful.

Activity

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions