Skip to content

fix(napplet): install from bytes already on this device - #153

Merged
Origami74 merged 1 commit into
mainfrom
fix/napplet-install-local-blobs
Oct 19, 2026
Merged

Origami74 merged 1 commit into
mainfrom
fix/napplet-install-local-blobs

Conversation

@Origami74

@Origami74 Origami74 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

What

Installing a napplet uses bytes already on this phone before asking anyone else.

Why

The install view asked mesh peers and public Blossom servers for the artifact, never this phone's own store. A napplet published straight to the phone's Blossom, or kept by an earlier install, could not be installed offline: blob-unavailable: no source served artifact ….

How

SourceBlobs (the view resolve reads through during ingest) asks the local BlobStore first, then the source.

The local copy is used only when it hashes to the name asked for. A damaged copy is logged at debug and falls through to source.fetch_blob, so Download again, updates and Circle pushes can still repair it. resolve re-hashes whatever comes back as well.

CHANGELOG [Unreleased] has a Fixed entry.

Testing

  • New host tests: bytes_already_here_install_without_a_source, and a_damaged_local_copy_is_fetched_again (a store whose get answers wrong bytes under the right name, plus a source with the good blob: ingest succeeds and the napplet opens). The second fails without the hash check.
  • Existing ingest tests pass (ingest_verifies_then_stores_and_the_napplet_opens_locally, a_failed_ingest_stores_nothing). Other napplet::tests failures locally are all the LMDB ENOSPC issue on this Mac.
  • On device (A52): a napplet deployed only to the phone's own relay and Blossom (via adb forward) failed to install before, installs after, with no internet.

An install asked mesh peers and public Blossom servers for the napplet's
bytes, never this phone's own store. A napplet published straight to the
phone's Blossom, or kept by an earlier install, could not be installed
offline: 'no source served artifact'.

Root cause: the install view (SourceBlobs) resolved only against the
remote PeerSource.

The install view now asks the local store first, and uses a local copy
only when it hashes to the name asked for. A damaged copy falls through
to the source, so Download again, updates and Circle pushes repair it
rather than meeting the same bad bytes. resolve still re-hashes whatever
comes back. Tests cover a source-less install from local bytes and a
damaged local copy fetched again; CHANGELOG has the Fixed entry.
@Origami74
Origami74 force-pushed the fix/napplet-install-local-blobs branch from 5ab1a40 to e8cf799 Compare October 19, 2026 14:58
@Origami74

Copy link
Copy Markdown
Owner Author

Thanks — fixed in e8cf799 (rebased on main).

  • SourceBlobs::get now uses the local copy only when it hashes to the requested name; a damaged copy is logged at debug and falls through to the source, so recovery paths can repair it.
  • New test a_damaged_local_copy_is_fetched_again (fails without the check).
  • CHANGELOG Fixed entry added.

@Origami74
Origami74 merged commit bb646b0 into main Oct 19, 2026
5 of 6 checks passed
@Origami74
Origami74 deleted the fix/napplet-install-local-blobs branch October 19, 2026 15:08
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.

1 participant