Skip to content

Commit

Permalink
fix: Close fetch response on HTTP broadcast sent (#412)
Browse files Browse the repository at this point in the history
Close fetch response on HTTP broadcast sent

Co-authored-by: Stas <[email protected]>
  • Loading branch information
filipecabaco and abc3 authored Jun 28, 2024
1 parent 264b37d commit 005cf12
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/RealtimeChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,8 @@ export default class RealtimeChannel {
opts.timeout ?? this.timeout
)

if (response.ok) {
return 'ok'
} else {
return 'error'
}
await response.body?.cancel()
return response.ok ? 'ok' : 'error'
} catch (error: any) {
if (error.name === 'AbortError') {
return 'timed out'
Expand Down

0 comments on commit 005cf12

Please sign in to comment.