Commit 399af4f
fix(fetcher): stop reporting progress before file sizes are known (#1415)
## Description
Progress jumped to a large value in the first second of a download and
then froze there. An LLM config fetches a model plus its tokenizer
files. HEAD lookups are started but deliberately not awaited, so every
uncached file begins at size 0 and falls back to an equal weight. The
tokenizer finishes long before the model's HEAD returns, so its
completion reported a big share of the job, and the monotonic guard held
the bar there until the model genuinely caught up.
Wait for every length lookup to settle before reporting a ratio over
them. A lookup that comes back empty still counts as settled, so a
failed HEAD cannot stall the other files, and the fallback weight is now
recomputed per report so a file measured mid-flight stops counting as an
estimate.
Stacked on #1414.
### Introduces a breaking change?
- [ ] Yes
- [x] No
### Type of change
- [x] Bug fix (change which fixes an issue)
- [ ] New feature (change which adds functionality)
- [ ] Documentation update (improves or adds clarity to existing
documentation)
- [ ] Other (chores, tests, code style improvements etc.)
### Tested on
- [ ] iOS
- [x] Android
### Testing instructions
1. Build `apps/nlp` or similar and open it.
2. Download any LLM model.
3. The bar stays near 0 while the lengths resolve, then climbs. Before
this it jumped to roughly 50 percent immediately and sat there.
### Related issues
Found while testing the example apps from #1414 on a Galaxy S26 Ultra.
### Checklist
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have updated the documentation accordingly
- [x] My changes generate no new warnings1 parent 5ac8202 commit 399af4f
1 file changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
902 | 902 | | |
903 | 903 | | |
904 | 904 | | |
905 | | - | |
906 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
907 | 912 | | |
908 | 913 | | |
909 | 914 | | |
910 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
911 | 922 | | |
912 | 923 | | |
913 | 924 | | |
| |||
929 | 940 | | |
930 | 941 | | |
931 | 942 | | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
936 | 949 | | |
937 | 950 | | |
938 | 951 | | |
| |||
0 commit comments