Skip to content

Commit 7f70e42

Browse files
Removing diagnostic
1 parent 0fe1f97 commit 7f70e42

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

.github/workflows/build-test-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v3
2121
- uses: actions/setup-node@v3
2222
with:
23-
node-version: '21.x'
23+
node-version: 21
2424
- name: Setup Dependencies
2525
run: |
2626
corepack enable
@@ -46,7 +46,7 @@ jobs:
4646
- uses: actions/checkout@v3
4747
- uses: actions/setup-node@v3
4848
with:
49-
node-version: '21.x'
49+
node-version: 21
5050
- name: Setup Dependencies
5151
run: |
5252
corepack enable

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [18.x, 20.x, 21.x]
12+
node-version: [20.x, 21.x]
1313

1414
steps:
1515
- uses: actions/checkout@v3

src/transport-tls.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,13 @@ export class TlsSocketTransport implements ConnectionTransport {
7373
this.socket = tls.connect(this.config.port as number, this.config.host, this.config.tlsOptions, () => {
7474
if (!this.socket?.authorized) {
7575
const anonimizedError = anonimizeError((this.socket as TLSSocket).authorizationError)
76-
console.debug('Connection was not authorized', anonimizedError)
76+
console.error('Connection was not authorized', anonimizedError)
7777
this.close()
7878
finish(new SQLiteCloudError('Connection was not authorized', { cause: anonimizedError }))
7979
} else {
8080
// the connection was closed before it was even opened,
8181
// eg. client closed the connection before the server accepted it
8282
if (this.socket === null) {
83-
console.debug('Connection was closed before it was opened')
8483
finish(new SQLiteCloudError('Connection was closed before it was done opening'))
8584
return
8685
}
@@ -102,13 +101,12 @@ export class TlsSocketTransport implements ConnectionTransport {
102101
})
103102

104103
this.socket.on('close', () => {
105-
console.debug('Connection closed')
106104
this.socket = null
107105
finish(new SQLiteCloudError('Connection was closed'))
108106
})
109107

110108
this.socket.once('error', (error: any) => {
111-
console.debug('Connection error', error)
109+
console.error('Connection error', error)
112110
finish(new SQLiteCloudError('Connection error', { cause: error }))
113111
})
114112

@@ -129,7 +127,6 @@ export class TlsSocketTransport implements ConnectionTransport {
129127
let buffer = Buffer.alloc(0)
130128
const rowsetChunks: Buffer[] = []
131129
const startedOn = new Date()
132-
console.debug(`Send: ${commands}`)
133130

134131
// define what to do if an answer does not arrive within the set timeout
135132
let socketTimeout: number
@@ -166,7 +163,7 @@ export class TlsSocketTransport implements ConnectionTransport {
166163
bufferString = bufferString.substring(0, 100) + '...' + bufferString.substring(bufferString.length - 40)
167164
}
168165
const elapsedMs = new Date().getTime() - startedOn.getTime()
169-
console.debug(`Receive: ${bufferString} - ${elapsedMs}ms`)
166+
// console.debug(`Receive: ${bufferString} - ${elapsedMs}ms`)
170167
}
171168

172169
// need to decompress this buffer before decoding?
@@ -189,7 +186,6 @@ export class TlsSocketTransport implements ConnectionTransport {
189186
rowsetChunks.push(buffer)
190187
buffer = Buffer.alloc(0)
191188
const okCommand = formatCommand('OK')
192-
console.debug(`Send: ${okCommand}`)
193189
this.socket?.write(okCommand)
194190
}
195191
}
@@ -217,14 +213,14 @@ export class TlsSocketTransport implements ConnectionTransport {
217213
this.socket?.write(commands, 'utf8', () => {
218214
socketTimeout = setTimeout(() => {
219215
const timeoutError = new SQLiteCloudError('Request timed out', { cause: anonimizeCommand(commands) })
220-
console.debug(`Request timed out, config.timeout is ${this.config?.timeout as number}ms`, timeoutError)
216+
// console.debug(`Request timed out, config.timeout is ${this.config?.timeout as number}ms`, timeoutError)
221217
finish(timeoutError)
222218
}, this.config?.timeout)
223219
this.socket?.on('data', readData)
224220
})
225221

226222
this.socket?.once('error', (error: any) => {
227-
console.debug('Socket error', error)
223+
console.error('Socket error', error)
228224
this.close()
229225
finish(new SQLiteCloudError('Socket error', { cause: anonimizeError(error) }))
230226
})

test/connection-ws.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('connection-ws', () => {
4949
const configObj = getChinookConfig()
5050
configObj.connectionString?.replace(configObj.password as string, 'wrongpassword')
5151
configObj.password = 'wrongpassword'
52-
configObj.useWebsocket = true
52+
configObj.useWebsocket = true
5353

5454
// should attemp connection and return error
5555
const connection = new SQLiteCloudConnection(configObj)
@@ -281,7 +281,7 @@ describe('connection-ws', () => {
281281
},
282282
LONG_TIMEOUT
283283
)
284-
/* TODO RESTORE TEST
284+
/* TODO RESTORE TEST
285285
it('should apply short timeout', done => {
286286
// apply shorter timeout
287287
const configObj = parseConnectionString(CHINOOK_DATABASE_URL + '?timeout=20')
@@ -303,8 +303,9 @@ describe('connection-ws', () => {
303303
}
304304
})
305305
})
306-
})
307306
*/
307+
})
308+
308309
describe('send select commands', () => {
309310
it('should LIST METADATA', done => {
310311
chinook.sendCommands('LIST METADATA;', (error, results) => {

0 commit comments

Comments
 (0)