Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates always download full app, not patch #167

Open
abenzick opened this issue Dec 9, 2024 · 1 comment
Open

Updates always download full app, not patch #167

abenzick opened this issue Dec 9, 2024 · 1 comment
Assignees

Comments

@abenzick
Copy link

abenzick commented Dec 9, 2024

Hello,

I'm having great success with Tufup but I've noticed that whenever I push updates, the app always downloads the full version of the application. My app is around 80mb and I do really small patches. Tufup generates the patches in new targets and they are around 700kb size. Existing users get notified there's an update but instead of downloading the 700kb patch, it downloads the 80mb file each time.

I'm using tufup 0.9.0 and I feel like the metadata and the targets are getting generated properly. Here is an example of the targets meta data below. Any suggestions of what I'm doing wrong?

  "AMP-1.2.9.patch": {
    "custom": {
      "tufup": {
        "tar_hash": "XX",
        "tar_hash_algorithm": "sha256",
        "tar_size": 85882880
      },
      "user": null
    },
    "hashes": {
      "sha256": "XX"
    },
    "length": 1143453
  },
  "AMP-1.2.9.tar.gz": {
    "custom": {
      "tufup": {
        "required": false
      },
      "user": null
    },
    "hashes": {
      "sha256": "XX"
    },
    "length": 85003534
  },
@dennisvang
Copy link
Owner

[...] Existing users get notified there's an update but instead of downloading the 700kb patch, it downloads the 80mb file each time.

Hi @abenzick, thanks for the detailed report.

I'm not sure what causes this, but here's the logic used to decide whether to do a patch update:

tufup/src/tufup/client.py

Lines 246 to 247 in 473045f

if not patch or no_patches or patch_too_big or no_archive or abort_patch:
# fall back on full update

To summarize:

  • patch: value of the patch arg specified in check_for_updates() (default True)
  • no_patches: no patches found
  • patch_too_big: patch found, but almost as big as the archive itself
  • no_archive: no archive found, so cannot apply patch
  • abort_patch: true if any of the new patches have failed on a previous run

Does any of those look like a likely culprit to you?

If you could run your app with log level DEBUG, that could help us figure this out.

(note to self: more fine-grained debug logging would have been convenient here...)

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

No branches or pull requests

2 participants