neo4j / neo4j-browser

Neo4j Browser is the general purpose user interface for working with Neo4j. Query, visualize, administrate and monitor the database.
https://neo4j.com
GNU General Public License v3.0
689 stars 348 forks source link

Neo4j web interface returns empty string for field values that start with '<' #1234

Closed achantavy closed 3 years ago

achantavy commented 3 years ago

Description

Hi, I've found a case where the Neo4j browser app returns an empty string for field values that start with < when the cypher-shell does not have this issue. Please read below for details.

Reproduce Steps

  1. Run the following repro script in Python under neo4j driver 1.7.6:
from neo4j import GraphDatabase
neo4j_driver = GraphDatabase.driver("bolt://localhost:7687")
neo4j_session = neo4j_driver.session()

data = [
    {
        'id': 'httplib2',
        'name': 'httplib2',
        'repo_url': 'https://github.com/example_org/sample_repo_1',
        'specifier': '<0.7.0',
    },
    {
        'id': 'httplib2',
        'name': 'httplib2',
        'repo_url': 'https://github.com/example_org/sample_repo_2',
        'specifier': '>0.7.0',
    },
]

add_repo_1 = """
MERGE (:GitHubRepository{id:"https://github.com/example_org/sample_repo_1"})
"""
neo4j_session.run(add_repo_1)

add_repo_2 = """
MERGE (:GitHubRepository{id:"https://github.com/example_org/sample_repo_2"})
"""
neo4j_session.run(add_repo_2)

query = """
    UNWIND {Requirements} AS req
        MERGE (lib:PythonLibrary:Dependency{id: req.id})
        SET lib.name = req.name,
        lib.version = req.version

        WITH lib, req
        MATCH (repo:GitHubRepository{id: req.repo_url})
        MERGE (repo)-[r:REQUIRES]->(lib)
        SET r.specifier = req.specifier
    """

neo4j_session.run(
    query,
    Requirements=data,
)
  1. Then, run match(g:GitHubRepository)-[r]-(l:PythonLibrary)return g.id, l.name, r.specifier; in the Neo4j web UI, and run the same thing in cypher-shell.

Expected Behavior

Running match(g:GitHubRepository)-[r]-(l:PythonLibrary)return g.id, l.name, r.specifier; in the web browser should return the same result as in cypher-shell. That is,

Cypher shell returns:

neo4j> match(g:GitHubRepository)-[r]-(l:PythonLibrary)return g.id, l.name, r.specifier;
+---------------------------------------------------------------------------+
| g.id                                           | l.name     | r.specifier |
+---------------------------------------------------------------------------+
| "https://github.com/example_org/sample_repo_2" | "httplib2" | ">0.7.0"    |
| "https://github.com/example_org/sample_repo_1" | "httplib2" | "<0.7.0"    |
+---------------------------------------------------------------------------+

2 rows available after 10 ms, consumed after another 0 ms

And I would expect the Neo4j web browser to return the same thing.

Current Behavior

The Neo4j web browser returns empty string for the r.specifier value that starts with a <: image

Your Environment

software name version
OS OSX (local dev machine)
Web browser Chrome
Neo4j Browser 4.1.0
Neo4j 3.5.20 Enterprise
Python Neo4j driver 1.7.6
OskarDamkjaer commented 3 years ago

Hi, thanks for reporting this!

I just tried to reproduce this in 4.1.4 and I'm unable to do so. I've done some work in this area recently so it might already be fixed. Could you try and see if it's still present in the latest release?

OskarDamkjaer commented 3 years ago

If you are able to reproduce the issue in the most recent version of browser, please re-open this issue