Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

fix: use-setstate-synchronously edge cases #1128

Merged

Conversation

Desdaemon
Copy link
Contributor

What is the purpose of this pull request? (put an "X" next to an item)

  • Documentation update
  • Bug fix
  • New rule
  • Changes an existing rule
  • Add autofixing to a rule
  • Add a CLI option
  • Add something to the core
  • Other, please explain:

What changes did you make? (Give an overview)

Fixes mountedness invalidation in this case:

if (mounted) { // or 'while'
  await fetch();
}
setState(() {}); // LINT

Is there anything you'd like reviewers to focus on?

@Desdaemon
Copy link
Contributor Author

Since this lint is yet to be released, should I still add this fix to the changelog?

@incendial incendial self-requested a review December 28, 2022 21:04
@incendial incendial added this to the 5.4.0 milestone Dec 28, 2022
@incendial
Copy link
Member

@Desdaemon yeah, please add it to start the tests pipeline

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Merging #1128 (676a198) into master (1630010) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1128      +/-   ##
==========================================
- Coverage   85.38%   85.37%   -0.01%     
==========================================
  Files         348      348              
  Lines        7743     7742       -1     
==========================================
- Hits         6611     6610       -1     
  Misses       1132     1132              
Impacted Files Coverage Δ
...rules_list/use_setstate_synchronously/visitor.dart 93.10% <100.00%> (-0.12%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@incendial incendial merged commit 0f3199e into dart-code-checker:master Dec 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants