Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

# UNRELEASED

### Frontend canister

Sets the `ic_env` cookie for all HTML files only if the canister environment changed in the `commit_batch` method.

- Module hash: c156183e6a6f5c3c71ecde5f38a7280b770ff172b4827127ef03b89b764065ba
- https://github.com/dfinity/sdk/pull/4446

# 0.30.2

### Improve frontend canister sync logic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ impl State {
system_context: &SystemContext,
) -> Result<(), String> {
// Reload the canister env to get the latest values
let old_encoded_canister_env = self.encoded_canister_env.clone();
self.encoded_canister_env = system_context.get_canister_env().to_cookie_value();

let (chunks_added, bytes_added) = self.compute_last_chunk_data(&arg);
Expand All @@ -753,7 +754,12 @@ impl State {
self.batches.remove(&batch_id);
self.certify_404_if_required();

self.update_ic_env_cookie_in_html_files();
// Only re-certify all HTML files if the canister environment changed.
// Assets modified in this batch already have the correct cookie via on_asset_change.
// Note: this can cause the canister to incur in the instructions limit with many assets.
if old_encoded_canister_env != self.encoded_canister_env {
self.update_ic_env_cookie_in_html_files();
}
self.last_state_update_timestamp_ns = system_context.current_timestamp_ns;

Ok(())
Expand Down
Binary file modified src/distributed/assetstorage.wasm.gz
Binary file not shown.
Loading