diff --git a/src/browser/modules/Stream/Auth/ConnectionForm.jsx b/src/browser/modules/Stream/Auth/ConnectionForm.jsx index 6992afc14ee..dcc3e986680 100644 --- a/src/browser/modules/Stream/Auth/ConnectionForm.jsx +++ b/src/browser/modules/Stream/Auth/ConnectionForm.jsx @@ -46,7 +46,7 @@ import { NATIVE, NO_AUTH } from 'services/bolt/boltHelpers' import ConnectForm from './ConnectForm' import ConnectedView from './ConnectedView' import ChangePasswordForm from './ChangePasswordForm' -import { getAllowedBoltSchemes, inCloudEnv } from 'shared/modules/app/appDuck' +import { getAllowedBoltSchemes } from 'shared/modules/app/appDuck' import { FOCUS } from 'shared/modules/editor/editorDuck' import { generateBoltUrl, @@ -316,10 +316,9 @@ export class ConnectionForm extends Component { password={this.state.password} database={this.state.requestedUseDb} authenticationMethod={this.state.authenticationMethod} - supportsMultiDb={this.state.supportsMultiDb} used={this.state.used} allowedSchemes={this.props.allowedSchemes} - allowedAuthMethods={this.props.allowedAuthMethods} + supportsMultiDb={this.state.supportsMultiDb} /> ) } @@ -335,8 +334,7 @@ const mapStateToProps = state => { playImplicitInitCommands: getPlayImplicitInitCommands(state), storeCredentials: shouldRetainConnectionCredentials(state), isConnected: isConnected(state), - allowedSchemes: getAllowedBoltSchemes(state), - allowedAuthMethods: inCloudEnv(state) ? [NATIVE] : [NATIVE, NO_AUTH] + allowedSchemes: getAllowedBoltSchemes(state) } } @@ -358,7 +356,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { storeCredentials: stateProps.storeCredentials, isConnected: stateProps.isConnected, allowedSchemes: stateProps.allowedSchemes, - allowedAuthMethods: stateProps.allowedAuthMethods, ...ownProps, ...dispatchProps, executeInitCmd: () => { diff --git a/src/shared/modules/app/appDuck.js b/src/shared/modules/app/appDuck.js index 4ee53292214..e7f9db9f369 100644 --- a/src/shared/modules/app/appDuck.js +++ b/src/shared/modules/app/appDuck.js @@ -39,7 +39,6 @@ export const getEnv = state => (state[NAME] || {}).env || WEB export const hasDiscoveryEndpoint = state => [WEB, CLOUD].includes(getEnv(state)) export const inWebEnv = state => getEnv(state) === WEB -export const inCloudEnv = state => getEnv(state) === WEB export const inWebBrowser = state => [WEB, CLOUD].includes(getEnv(state)) export const getAllowedBoltSchemes = (state, encryptionFlag) => { const isHosted = inWebBrowser(state) diff --git a/src/shared/modules/cypher/cypherDuck.js b/src/shared/modules/cypher/cypherDuck.js index 548832921b4..3793dae0eb2 100644 --- a/src/shared/modules/cypher/cypherDuck.js +++ b/src/shared/modules/cypher/cypherDuck.js @@ -27,10 +27,6 @@ import { buildTxFunctionByMode } from 'services/bolt/boltHelpers' import { flatten } from 'services/utils' import { shouldUseCypherThread } from 'shared/modules/settings/settingsDuck' import { getUserTxMetadata } from 'services/bolt/txMetadata' -import { applyGraphTypes } from 'services/bolt/boltMappings' -import { arrayToObject } from 'services/utils' -import { send } from 'shared/modules/requests/requestsDuck' -import { map } from 'lodash-es' import { canSendTxMetadata, changeUserPasswordQuery, @@ -134,6 +130,7 @@ export const routedCypherRequestEpic = (some$, store) => ...getUserTxMetadata(action.queryType || null)({ hasServerSupport: canSendTxMetadata(store.getState()) }), + cancelable: true, useDb: action.useDb } ) diff --git a/src/shared/services/bolt/bolt.js b/src/shared/services/bolt/bolt.js index 457a1f3c76f..cac41f7eae1 100644 --- a/src/shared/services/bolt/bolt.js +++ b/src/shared/services/bolt/bolt.js @@ -78,6 +78,7 @@ function routedWriteTransaction(input, parameters, requestMetaData = {}) { const { useCypherThread = false, requestId = null, + cancelable = false, onLostConnection = () => {}, txMetadata = undefined, autoCommit = false, @@ -90,7 +91,7 @@ function routedWriteTransaction(input, parameters, requestMetaData = {}) { mappings.recursivelyTypeGraphItems(parameters), boltConnection.ROUTED_WRITE_CONNECTION, id, - true /* later assumed to be cancelable */, + cancelable, { ...connectionProperties, txMetadata, diff --git a/src/shared/services/bolt/boltWorker.js b/src/shared/services/bolt/boltWorker.js index aced880d031..a146f0ea85c 100644 --- a/src/shared/services/bolt/boltWorker.js +++ b/src/shared/services/bolt/boltWorker.js @@ -84,22 +84,18 @@ const onmessage = function(message) { applyGraphTypes(parameters), { requestId, cancelable, txMetadata, useDb, autoCommit } ) - try { - connectionTypeMap[connectionType] - .getPromise(res) - .then(r => { - afterWork() - self.postMessage(cypherResponseMessage(r)) - }) - .catch(e => { - afterWork() - self.postMessage( - cypherErrorMessage({ code: e.code, message: e.message }) - ) - }) - } catch (error) { - console.log(error, connectionType, connectionTypeMap, res) - } + connectionTypeMap[connectionType] + .getPromise(res) + .then(r => { + afterWork() + self.postMessage(cypherResponseMessage(r)) + }) + .catch(e => { + afterWork() + self.postMessage( + cypherErrorMessage({ code: e.code, message: e.message }) + ) + }) }) .catch(e => { afterWork()