Skip to content

Commit

Permalink
Remove unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer committed Oct 30, 2020
1 parent 98fc792 commit 6dd0f57
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
9 changes: 3 additions & 6 deletions src/browser/modules/Stream/Auth/ConnectionForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}
/>
)
}
Expand All @@ -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)
}
}

Expand All @@ -358,7 +356,6 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
storeCredentials: stateProps.storeCredentials,
isConnected: stateProps.isConnected,
allowedSchemes: stateProps.allowedSchemes,
allowedAuthMethods: stateProps.allowedAuthMethods,
...ownProps,
...dispatchProps,
executeInitCmd: () => {
Expand Down
1 change: 0 additions & 1 deletion src/shared/modules/app/appDuck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions src/shared/modules/cypher/cypherDuck.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -134,6 +130,7 @@ export const routedCypherRequestEpic = (some$, store) =>
...getUserTxMetadata(action.queryType || null)({
hasServerSupport: canSendTxMetadata(store.getState())
}),
cancelable: true,
useDb: action.useDb
}
)
Expand Down
3 changes: 2 additions & 1 deletion src/shared/services/bolt/bolt.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function routedWriteTransaction(input, parameters, requestMetaData = {}) {
const {
useCypherThread = false,
requestId = null,
cancelable = false,
onLostConnection = () => {},
txMetadata = undefined,
autoCommit = false,
Expand All @@ -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,
Expand Down
28 changes: 12 additions & 16 deletions src/shared/services/bolt/boltWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6dd0f57

Please sign in to comment.