Thanks I pushed a squashed commit with new changes.
For base_dir "You should not free this return value.", I interpreted that as "move the call outside the for loop". If you didn't mean that, please tell me and I'll change it again. Sorry I'm a glib newbie.
Lookup extra-data files as
~/.local/share/flatpak/extra-data/SHA256/FILENAME, Similar to files
downloaded in the .flatpak-builder directory.
For now, if a corresponding file exists, assume it's the full download
and read bytes from it. Then proceed to do the same checks as for the
bytes downloaded by Soup.
In the future this directory could be used to support resumed downloads
by storing partial downloads.