Skip to content

[refactor] refactor-language-download#11

Merged
GabrielSousa02 merged 14 commits into
mainfrom
refactor/refactor-language-download
Jun 9, 2026
Merged

[refactor] refactor-language-download#11
GabrielSousa02 merged 14 commits into
mainfrom
refactor/refactor-language-download

Conversation

@GabrielSousa02

Copy link
Copy Markdown
Collaborator

What?

Create local download manager for languages and remove download_assets package.

  • test: create tests for new language_downloader feature
  • build: add new archive dependency and bump minor versions
  • feat: create new custom language_downloader util
  • feat: wire new language_downloader into globals
  • feat: wire new language_downloader into background_task
  • feat: wire new language_downloader into main
  • test: update background_test
  • build: update pubspec files to remove download_assets
  • refactor: update languages.dart to use the new language_downloader
  • refactor: update usage of provider in update_language_button
  • refactor: update background_task to use new provider setup
  • test: update tests to use new language_downloader and provider
  • refactor: remove unnecessary non-null assertion with dart fix

Why?

This removes an unnecessary dependency on the project, which makes it more reliable,
and less prone to update issues. Which was already happening with the latest version
of download_assets.

How?

Created custom download classes and functions that is able to fetch the two files per
language at the same time and unpack the zip in which they come, as per the current
setup of the application and content distribution.

Testing?

New testes were added, and all automated tests passing locally.

Screenshots (optional)

N/A

Anything Else?

N/A

@GabrielSousa02 GabrielSousa02 self-assigned this May 23, 2026
@GabrielSousa02

Copy link
Copy Markdown
Collaborator Author

@holybiber Here's the refactor I've been working on to remove download_assets package that was being a problem to us.

Tests are passing, and local emulators are working, download actually feels even faster at the moment.

Would like to take a look and test it before I merge it?

@GabrielSousa02 GabrielSousa02 requested a review from holybiber May 23, 2026 23:03

@holybiber holybiber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Gabriel, thanks a lot!
This looks good to me. It's good to get rid of download_assets and have our own code instead. I like that you download the pdf and the html archives in parallel, that already doubles the download speed. Did some quick tests on my phone, with the current code downloading all languages took 83s, with this PR it only took 38s.
Can you remove all remaining mentions of download_assets from our documentation?
And then go ahead and merge it!

@holybiber holybiber mentioned this pull request May 31, 2026
@GabrielSousa02 GabrielSousa02 merged commit badb484 into main Jun 9, 2026
4 checks passed
@GabrielSousa02 GabrielSousa02 deleted the refactor/refactor-language-download branch June 9, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants