Skip to content

Commit 491bd1b

Browse files
Merge pull request #1983 from daveajrussell/bump-neo4j-driver-version
Bump neo4j-driver to latest version, and update all requisite dependencies
2 parents 8ea93d0 + 65c0906 commit 491bd1b

File tree

11 files changed

+2797
-1684
lines changed

11 files changed

+2797
-1684
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,15 @@
7878
"@typescript-eslint/no-this-alias": "warn",
7979
"@typescript-eslint/no-unused-vars": "warn",
8080
"@typescript-eslint/no-var-requires": "warn",
81+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
82+
"@typescript-eslint/no-loss-of-precision": "warn",
8183
"no-var": "warn",
8284
"prefer-rest-params": "warn",
8385
"prefer-spread": "warn",
8486
"react-hooks/exhaustive-deps": "warn",
8587
"react-hooks/rules-of-hooks": "warn",
8688
"react/no-unescaped-entities": "warn",
89+
"react/no-unknown-property": "warn",
8790
"react/prop-types": "error"
8891
}
8992
},

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"@types/styled-components": "^5.1.1",
103103
"@types/uuid": "^8.3.0",
104104
"@types/whatwg-url": "^8.2.1",
105-
"@typescript-eslint/eslint-plugin": "^3.9.0",
106-
"@typescript-eslint/parser": "^3.9.0",
105+
"@typescript-eslint/eslint-plugin": "^6.21.0",
106+
"@typescript-eslint/parser": "^6.21.0",
107107
"autoprefixer": "^7.1.4",
108108
"babel-eslint": "^10.0.3",
109109
"babel-jest": "^25.2.4",
@@ -117,22 +117,22 @@
117117
"cross-env": "^6.0.3",
118118
"css-loader": "^1.0.0",
119119
"cypress": "^8.3.1",
120-
"eslint": "^7.7.0",
120+
"eslint": "^8.57.1",
121121
"eslint-config-prettier": "^6.7.0",
122-
"eslint-plugin-import": "^2.18.2",
123122
"eslint-plugin-jsx": "^0.1.0",
124123
"eslint-plugin-node": "^10.0.0",
125124
"eslint-plugin-promise": "^4.2.1",
126-
"eslint-plugin-react": "^7.17.0",
127-
"eslint-plugin-react-hooks": "^4.1.2",
125+
"eslint-plugin-import": "^2.31.0",
126+
"eslint-plugin-react": "^7.37.1",
127+
"eslint-plugin-react-hooks": "^4.6.2",
128128
"express": "^4.15.4",
129129
"file-loader": "^2.0.0",
130130
"fork-ts-checker-notifier-webpack-plugin": "^3.0.0",
131131
"fork-ts-checker-webpack-plugin": "^5.0.14",
132132
"html-loader": "^0.5.5",
133133
"html-webpack-plugin": "^4.5.2",
134134
"husky": "^0.14.3",
135-
"jest": "^25.2.4",
135+
"jest": "^26.6.3",
136136
"jest-canvas-mock": "^1.1.0",
137137
"js2xmlparser": "^3.0.0",
138138
"json-loader": "^0.5.7",
@@ -146,18 +146,18 @@
146146
"postcss-loader": "^3.0.0",
147147
"postcss-preset-env": "^3.0.2",
148148
"precss": "^2.0.0",
149-
"prettier-eslint": "^13.0.0",
150-
"prettier-eslint-cli": "^5.0.0",
149+
"prettier-eslint": "^16.3.0",
150+
"prettier-eslint-cli": "^8.0.1",
151151
"raf": "^3.4.0",
152152
"raw-loader": "^0.5.1",
153153
"react-hot-loader": "^4.13.0",
154154
"react-refresh": "^0.11.0",
155155
"react-test-renderer": "^17.0.2",
156156
"redux-mock-store": "^1.2.3",
157157
"style-loader": "^0.23.1",
158-
"ts-jest": "^25.0.0",
158+
"ts-jest": "^26.5.6",
159159
"ts-loader": "^8.0.2",
160-
"typescript": "^3.9.5",
160+
"typescript": "^4.6.3",
161161
"typescript-plugin-styled-components": "^1.5.0",
162162
"url-loader": "^1.1.2",
163163
"wait-on": "^3.1.0",
@@ -206,7 +206,8 @@
206206
"memoize-one": "^5.2.1",
207207
"monaco-editor": "0.23.0",
208208
"neo4j-client-sso": "1.2.3",
209-
"neo4j-driver": "5.9.2",
209+
"neo4j-driver": "5.26.0",
210+
"neo4j-driver-core": "5.26.0",
210211
"re-resizable": "^6.9.9",
211212
"react": "^17.0.2",
212213
"react-dnd": "^11.1.3",

src/neo4j-arc/common/types/cypherDataTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export type CypherBasicPropertyType =
7272
| number
7373
| string
7474
| Integer
75-
| BigInt
75+
| bigint
7676
| Int8Array
7777
| CypherTemporalType
7878
| Point

src/neo4j-arc/common/utils/objectUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ export function mapObjectValues<A, B>(
4040
)
4141
}
4242

43-
export function keys<T>(object: T): Array<keyof T> {
43+
export function keys<T extends {}>(object: T): Array<keyof T> {
4444
return Object.keys(object) as Array<keyof T>
4545
}

src/shared/modules/commands/cypher.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { version } from 'project-root/package.json'
3030
import { flushPromises } from 'services/utils'
3131

3232
jest.mock('services/bolt/bolt', () => {
33-
const orig = require.requireActual('services/bolt/bolt')
33+
const orig = jest.requireActual('services/bolt/bolt')
3434
return {
3535
...orig,
3636
routedWriteTransaction: jest.fn(() => [
@@ -39,26 +39,26 @@ jest.mock('services/bolt/bolt', () => {
3939
])
4040
}
4141
})
42-
const bolt = require.requireMock('services/bolt/bolt')
42+
const bolt = jest.requireMock('services/bolt/bolt')
4343

4444
jest.mock('shared/modules/params/paramsDuck', () => {
45-
const orig = require.requireActual('shared/modules/params/paramsDuck')
45+
const orig = jest.requireActual('shared/modules/params/paramsDuck')
4646
return {
4747
...orig,
4848
getParams: () => ({})
4949
}
5050
})
5151

5252
jest.mock('shared/modules/dbMeta/dbMetaDuck', () => {
53-
const orig = require.requireActual('shared/modules/dbMeta/dbMetaDuck')
53+
const orig = jest.requireActual('shared/modules/dbMeta/dbMetaDuck')
5454
return {
5555
...orig,
5656
getRawVersion: () => '3.5.0' // support for tx metadata
5757
}
5858
})
5959

6060
jest.mock('shared/modules/settings/settingsDuck', () => {
61-
const orig = require.requireActual('shared/modules/dbMeta/dbMetaDuck')
61+
const orig = jest.requireActual('shared/modules/dbMeta/dbMetaDuck')
6262
return {
6363
...orig,
6464
shouldUseReadTransactions: () => false

src/shared/modules/commands/use-db-ww.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jest.mock('shared/modules/params/paramsDuck', () => {
4242
})
4343

4444
jest.mock('shared/modules/settings/settingsDuck', () => {
45-
const orig = require.requireActual('shared/modules/dbMeta/dbMetaDuck')
45+
const orig = jest.requireActual('shared/modules/dbMeta/dbMetaDuck')
4646
return {
4747
...orig,
4848
shouldUseReadTransactions: () => false

src/shared/services/bolt/driverFactory.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import neo4j, { AuthToken, Config, Driver } from 'neo4j-driver'
2121

2222
import { version } from 'project-root/package.json'
23+
import { isError } from 'shared/utils/typeguards'
2324

2425
export const createDriverOrFailFn = (
2526
url: string,
@@ -34,7 +35,9 @@ export const createDriverOrFailFn = (
3435
const res = neo4j.driver(url, auth, spreadOpts)
3536
return res
3637
} catch (e) {
37-
failFn(e)
38+
if (isError(e)) {
39+
failFn(e)
40+
}
3841
return null
3942
}
4043
}

src/shared/services/bolt/globalDrivers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
toNonRoutingScheme
2828
} from 'services/boltscheme.utils'
2929
import { Connection } from 'shared/modules/connections/connectionsDuck'
30+
import { isBrowserError, isError } from 'shared/utils/typeguards'
3031

3132
interface GlobalDriversObject {
3233
getDirectDriver: () => Driver | null
@@ -64,8 +65,10 @@ export const buildGlobalDriversObject = async (
6465
routed && (await routed.verifyConnectivity())
6566
routingSupported = true
6667
} catch (e) {
67-
if (e && isNonSupportedRoutingSchemeError(e)) {
68-
routingSupported = false
68+
if (e && isError(e)) {
69+
if (isBrowserError(e) && isNonSupportedRoutingSchemeError(e)) {
70+
routingSupported = false
71+
}
6972
failFn(e)
7073
}
7174
}

src/shared/services/commandInterpreterHelper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ import {
110110
getCurrentDatabase,
111111
isSystemOrCompositeDb
112112
} from 'shared/utils/selectors'
113+
import { isBrowserError } from 'shared/utils/typeguards'
113114

114115
const PLAY_FRAME_TYPES = ['play', 'play-remote']
115116

@@ -264,7 +265,7 @@ const availableCommands = [
264265
})
265266
)
266267
}
267-
if (action.requestId) {
268+
if (action.requestId && isBrowserError(error)) {
268269
put(updateQueryResult(action.requestId, error, 'error'))
269270
}
270271
}

src/shared/utils/typeguards.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { BrowserError } from 'services/exceptions'
2+
3+
export function isError(error: unknown): error is Error {
4+
return error instanceof Error
5+
}
6+
7+
export function isBrowserError(error: unknown): error is BrowserError {
8+
return error instanceof Error && 'code' in error
9+
}

0 commit comments

Comments
 (0)