Skip to content

Commit 01d252b

Browse files
committed
Update encryption.rs
1 parent 1aef133 commit 01d252b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

crates/fula-client/src/encryption.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,6 +2949,7 @@ impl EncryptedClient {
29492949
// fresh-seq page under the old root's page_index.
29502950
let shard_salt = manifest_snapshot.shard_salt().to_vec();
29512951
let dirty_pages = manifest_snapshot.take_dirty_pages();
2952+
#[cfg(not(target_arch = "wasm32"))]
29522953
let wal_mac = wal::derive_mac_key(&self.encryption.key_manager, bucket);
29532954
for page_id in dirty_pages.iter().copied() {
29542955
let page = manifest_snapshot.pages.get_mut(&page_id)
@@ -2960,6 +2961,7 @@ impl EncryptedClient {
29602961
let old_etag = manifest_snapshot.root.page_index.get(&page_id)
29612962
.and_then(|r| r.etag.clone());
29622963
page.seq = page.seq.wrapping_add(1);
2964+
#[cfg(not(target_arch = "wasm32"))]
29632965
if let Err(e) = wal::append(
29642966
bucket,
29652967
&wal_mac,
@@ -3017,6 +3019,7 @@ impl EncryptedClient {
30173019
// sufficient for idempotent-PUT replay at the same key, but
30183020
// only this post-PUT entry lets the next flush's `If-Match`
30193021
// match S3's actual state.
3022+
#[cfg(not(target_arch = "wasm32"))]
30203023
if let Err(e) = wal::append(
30213024
bucket,
30223025
&wal_mac,
@@ -3047,6 +3050,7 @@ impl EncryptedClient {
30473050
let new_dir_index_seq = if dir_index_dirty {
30483051
let next_dir_seq = prior_dir_index_seq.saturating_add(1);
30493052
let old_dir_etag = manifest_snapshot.root.dir_index_etag.clone();
3053+
#[cfg(not(target_arch = "wasm32"))]
30503054
if let Err(e) = wal::append(
30513055
bucket,
30523056
&wal_mac,
@@ -3094,6 +3098,7 @@ impl EncryptedClient {
30943098
// crash between here and the Phase-2 root PUT can be recovered
30953099
// without re-reading the dir-index object. Mirrors the
30963100
// post-PUT PageWrote above.
3101+
#[cfg(not(target_arch = "wasm32"))]
30973102
if let Err(e) = wal::append(
30983103
bucket,
30993104
&wal_mac,
@@ -3673,6 +3678,7 @@ impl EncryptedClient {
36733678
let mut manifest_snapshot = v7.manifest().clone();
36743679
let shard_salt = manifest_snapshot.shard_salt().to_vec();
36753680
let dirty_pages = manifest_snapshot.take_dirty_pages();
3681+
#[cfg(not(target_arch = "wasm32"))]
36763682
let wal_mac_pages = wal::derive_mac_key(&self.encryption.key_manager, bucket);
36773683
for page_id in dirty_pages.iter().copied() {
36783684
let page = match manifest_snapshot.pages.get_mut(&page_id) {
@@ -3687,6 +3693,7 @@ impl EncryptedClient {
36873693
let old_etag = manifest_snapshot.root.page_index.get(&page_id)
36883694
.and_then(|r| r.etag.clone());
36893695
page.seq = page.seq.wrapping_add(1);
3696+
#[cfg(not(target_arch = "wasm32"))]
36903697
if let Err(e) = wal::append(
36913698
bucket,
36923699
&wal_mac_pages,
@@ -3739,6 +3746,7 @@ impl EncryptedClient {
37393746
}
37403747
};
37413748
let etag = if put.etag.is_empty() { None } else { Some(put.etag) };
3749+
#[cfg(not(target_arch = "wasm32"))]
37423750
if let Err(e) = wal::append(
37433751
bucket,
37443752
&wal_mac_pages,
@@ -3763,6 +3771,7 @@ impl EncryptedClient {
37633771
// WAL::DirIndexWrote appended+fsynced BEFORE the PUT for crash-replay
37643772
// idempotency (same key, same seq, identical plaintext).
37653773
let dir_index_seq: u64 = 1;
3774+
#[cfg(not(target_arch = "wasm32"))]
37663775
if let Err(e) = wal::append(
37673776
bucket,
37683777
&wal_mac_pages,
@@ -3814,6 +3823,7 @@ impl EncryptedClient {
38143823
};
38153824
let new_dir_index_etag =
38163825
if dir_index_put.etag.is_empty() { None } else { Some(dir_index_put.etag) };
3826+
#[cfg(not(target_arch = "wasm32"))]
38173827
if let Err(e) = wal::append(
38183828
bucket,
38193829
&wal_mac_pages,

0 commit comments

Comments
 (0)