Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: connack timeout error 이벤트 emit 코드를 제거 #5

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,13 +846,12 @@
this.stream.setMaxListeners(1000)

clearTimeout(this.connackTimer)
console.log('connect :: setting up connackTimer : ', this.options.connectTimeout);

Check failure on line 849 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `····console.log('connect·::·setting·up·connackTimer·:·',·this.options.connectTimeout);` with `↹↹console.log(⏎↹↹↹'connect·::·setting·up·connackTimer·:·',⏎↹↹↹this.options.connectTimeout,⏎↹↹)`
//@ts-ignore

Check failure on line 850 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `····` with `↹↹`

Check failure on line 850 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 850 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected exception block, space or tab after '//' in comment
this.connackTimer = setTimeout(() => {
this.log(
'!!connectTimeout hit!! Calling _cleanUp with force `true`',
)
this.emit('error', new Error('connack timeout'))
this._cleanUp(true)
}, this.options.connectTimeout)

Expand Down Expand Up @@ -1691,7 +1690,7 @@
'_setupReconnect :: setting reconnectTimer for %d ms',
this.options.reconnectPeriod,
)
//@ts-ignore

Check failure on line 1693 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `······` with `↹↹↹`

Check failure on line 1693 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free

Check failure on line 1693 in src/lib/client.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Expected exception block, space or tab after '//' in comment
this.reconnectTimer = setInterval(() => {
this.log('reconnectTimer :: reconnect triggered!')
this._reconnect()
Expand Down
12 changes: 0 additions & 12 deletions test/abstract_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3004,18 +3004,6 @@ export default function abstractTest(server, config, ports) {
}, 50)
})

it('should emit connack timeout error', function _test(t, done) {
const client = connect({
connectTimeout: 0,
reconnectPeriod: 5000,
})

client.on('error', (err) => {
assert.equal(err.message, 'connack timeout')
client.end(true, done)
})
})

it(
'should resend in-flight QoS 1 publish messages from the client',
{
Expand Down
Loading