florinpatrascu / bolt_sips

Neo4j driver for Elixir
Apache License 2.0
256 stars 49 forks source link

Fix case where the version is without a patch: e.g. "Neo4j/3.5" #88

Closed barry-w-hill closed 4 years ago

barry-w-hill commented 4 years ago

I ran into an error trying to connect to an Aura Neo4j database together with Routing. The server version is returned as "Neo4j/3.5". The existing regex expression doesn't allow for that and the connection crashes.

Using Neo4j Browser the db version is the same (without a patch) "Neo4j Kernel" | "3.5" | "enterprise"

I've amended the code so that when it appears without a patch, it will return with patch of 0. i.e. "Neo4j/3.5" will return {"Neo4j/3.5", "3.5.0"} when parse_server_version is called. Otherwise patch versions will be included like normal

sourcelevel-bot[bot] commented 4 years ago

Hello, @barry-w-hill! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

sourcelevel-bot[bot] commented 4 years ago

SourceLevel has finished reviewing this Pull Request and has found:

See more details about this review.

barry-w-hill commented 4 years ago

@florinpatrascu One of the tests failed, but I don't think it has to do with the fix. I see it happened in another pull request. What do you suggest?

florinpatrascu commented 4 years ago

I believe this is 'easier" for the machine, would you agree?! ;) https://github.com/florinpatrascu/bolt_sips/blob/8ae27b583a887c12d7c83620f2f8417304c01818/lib/bolt_sips/router.ex#L355

Please let me know if the code from master is passing your tests, and I'll publish the new version.

Thanks again!

barry-w-hill commented 4 years ago

@florinpatrascu Hi, the code from master works in my case. Also happy with your implementation, just note I spotted a typo in the attribute name:

@sever_version_stringex @server_version_stringex

I'll publish the new version.

Thank you very much!

florinpatrascu commented 4 years ago

Published, thanks again!