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

🐛 Avoid Interceptors.clear removes ImplyContentTypeInterceptor #1975

Merged

Conversation

AlexV525
Copy link
Member

Resolves #1973

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

The PR only addresses clear. However, lists can be modified in various ways which might also remove/replace the interceptor. We might need to rethink an extra internal interceptors list.

Sorry, something went wrong.

@AlexV525 AlexV525 requested a review from a team as a code owner September 21, 2023 02:23
Copy link
Contributor

@ueman ueman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small nitpick

/// The default [ImplyContentTypeInterceptor] will be removed only if
/// [withImplyContentTypeInterceptor] is true.
@override
void clear({bool withImplyContentTypeInterceptor = false}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes it more understandable

Suggested change
void clear({bool withImplyContentTypeInterceptor = false}) {
void clear({bool keepImplyContentTypeInterceptor = true}) {

@AlexV525 AlexV525 added this pull request to the merge queue Sep 22, 2023
Merged via the queue into main with commit 0687488 Sep 22, 2023
@AlexV525 AlexV525 deleted the fix/interceptors-clear-without-imply-content-type-interceptor branch September 22, 2023 01:55
@AlexV525 AlexV525 added s: feature This issue indicates a feature request p: dio Targeting `dio` package and removed s: feature This issue indicates a feature request labels Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: dio Targeting `dio` package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dio 5 interceptors.clear() break the app
3 participants