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

Bad state: Cannot add event after closing #2115

Closed
AlexV525 opened this issue Feb 20, 2024 · 2 comments · Fixed by #2117
Closed

Bad state: Cannot add event after closing #2115

AlexV525 opened this issue Feb 20, 2024 · 2 comments · Fixed by #2117
Assignees
Labels
p: dio Targeting `dio` package platform: io s: bug Something isn't working

Comments

@AlexV525
Copy link
Member

AlexV525 commented Feb 20, 2024

Package

dio

Version

5.4.1

Operating-System

Android

Output of flutter doctor -v

No response

Dart Version

No response

Steps to Reproduce

  1. Set the receiveTimeout as 1 second when the request should take 2.
  2. Cancel the request before the 1 second.

Expected Result

No exceptions.

Actual Result

The following message was thrown:
Bad state: Cannot add event after closing

When the exception was thrown, this was the stack: 
#1      handleResponseStream.watchReceiveTimeout.<anonymous closure> (package:dio/src/response/response_stream_handler.dart:48:20)
#5      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
(elided 4 frames from class _Timer, dart:async, and dart:async-patch)
@AlexV525 AlexV525 added p: dio Targeting `dio` package s: bug Something isn't working platform: io labels Feb 20, 2024
@AlexV525 AlexV525 self-assigned this Feb 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 20, 2024
Fixes #2115

### New Pull Request Checklist

- [x] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [x] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [x] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [x] I have added the required tests to prove the fix/feature I'm
adding
- [ ] I have updated the documentation (if necessary)
- [x] I have run the tests without failures
- [x] I have updated the `CHANGELOG.md` in the corresponding package
@Reprevise
Copy link
Contributor

Can this be released in a new version of Dio?

@AlexV525
Copy link
Member Author

Can this be released in a new version of Dio?

Every unreleased change would be released in the next version, generally speaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: dio Targeting `dio` package platform: io s: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants