brendan-duncan / archive

Dart library to encode and decode various archive and compression formats, such as Zip, Tar, GZip, ZLib, and BZip2.
MIT License
400 stars 140 forks source link

Async / Futures handling fixes #322

Closed androidseb closed 7 months ago

androidseb commented 7 months ago

After finding a fix for a bug in my app requiring the implementation of ZipFileEncoder.close() to be adjusted, I also found a lot of places in the code where async code handling could be improved.

I started by adjusting the implementation of ZipFileEncoder.close() and adding those linter rules:

    - unawaited_futures
    - discarded_futures

It looks like a lot of places in the code could be improved with await / Future return declarations, but it could have implications I don't necessarily understand.

Should I look at doing more refactoring with the help of those linter rules, or should I remove those linter rules and keep the changes to the limited scope of ZipFileEncoder.close()?

brendan-duncan commented 7 months ago

Sorry it's taking a bit to get to this, super busy with lots of work stuff. I'll get to it soon.

brendan-duncan commented 7 months ago

Thanks, I appreciate it. Clearly the library is sloppy with async. Now the failing analysis is incentive to go in and clean it up. If you're up for it, you're welcome to. Otherwise I'll try and get to it. I feel bad when I don't get to this stuff in a timely manner. I have a habit of taking on too much work.

androidseb commented 7 months ago

I'll try and put up a PR to fix those linting issues soon, I don't mind doing it, I just wasn't sure this was what you wanted. Thanks for confirming :-)