@@ -3900,10 +3900,17 @@ impl EncryptedClient {
39003900 // server is reachable. Pages that have never been flushed
39013901 // (`page_ref.etag = None`) fall back to the no-hint wrapper;
39023902 // those pages have no on-IPFS bytes to fetch anyway.
3903- let cid_hint = page_ref
3903+ //
3904+ // Native-only: the `cid` crate is gated to non-wasm targets
3905+ // and the CID-hint method itself is too. On wasm we just
3906+ // route through the no-hint wrapper, which already handles
3907+ // master-up (the only fetch path supported on wasm anyway).
3908+ #[ cfg( not( target_arch = "wasm32" ) ) ]
3909+ let cid_hint: Option < cid:: Cid > = page_ref
39043910 . etag
39053911 . as_deref ( )
39063912 . and_then ( |s| s. parse :: < cid:: Cid > ( ) . ok ( ) ) ;
3913+ #[ cfg( not( target_arch = "wasm32" ) ) ]
39073914 let blob = match cid_hint {
39083915 Some ( cid) => self
39093916 . inner
@@ -3922,6 +3929,18 @@ impl EncryptedClient {
39223929 page_id, bucket, e
39233930 ) )
39243931 } ) ?;
3932+ #[ cfg( target_arch = "wasm32" ) ]
3933+ let blob = self
3934+ . inner
3935+ . get_object_with_offline_fallback ( bucket, & page_key)
3936+ . await
3937+ . map ( |r| r. inner . data )
3938+ . map_err ( |e| {
3939+ ClientError :: DownloadFailed ( format ! (
3940+ "failed to fetch manifest page {} for bucket {}: {}" ,
3941+ page_id, bucket, e
3942+ ) )
3943+ } ) ?;
39253944 let envelope = EncryptedManifestPage :: from_bytes ( & blob)
39263945 . map_err ( ClientError :: Encryption ) ?;
39273946 if envelope. page_id != * page_id {
@@ -3978,7 +3997,14 @@ impl EncryptedClient {
39783997 // CID-hint variant so a fresh device with no KEY_TO_CID
39793998 // warm-cache mapping can still race the gateway pool. The
39803999 // master-up path is identical regardless of hint.
3981- let cid_hint = expected_etag. and_then ( |s| s. parse :: < cid:: Cid > ( ) . ok ( ) ) ;
4000+ //
4001+ // Native-only: `cid` crate + the CID-hint method are gated to
4002+ // non-wasm targets. wasm builds keep the no-hint wrapper
4003+ // (master-only path).
4004+ #[ cfg( not( target_arch = "wasm32" ) ) ]
4005+ let cid_hint: Option < cid:: Cid > =
4006+ expected_etag. and_then ( |s| s. parse :: < cid:: Cid > ( ) . ok ( ) ) ;
4007+ #[ cfg( not( target_arch = "wasm32" ) ) ]
39824008 let blob = match cid_hint {
39834009 Some ( cid) => match self
39844010 . inner
@@ -4001,6 +4027,17 @@ impl EncryptedClient {
40014027 Err ( e) => return Err ( e) ,
40024028 } ,
40034029 } ;
4030+ #[ cfg( target_arch = "wasm32" ) ]
4031+ let blob = match self
4032+ . inner
4033+ . get_object_with_offline_fallback ( bucket, & key)
4034+ . await
4035+ . map ( |r| r. inner . data )
4036+ {
4037+ Ok ( b) => b,
4038+ Err ( e) if e. is_not_found ( ) => return Ok ( None ) ,
4039+ Err ( e) => return Err ( e) ,
4040+ } ;
40044041 // `get_object` discards the HEAD ETag so we cannot cross-check
40054042 // `expected_etag` here directly; it stays threaded for future refactors
40064043 // that expose the GET ETag on the read path. `expected_seq` is the
0 commit comments