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

refactor(frontend-canister): Asset is_aliased -> enable_aliasing #3161

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Note that as always, if `dfx deploy` does not completely upload and commit a bat

### Frontend canister

- Module hash: 99eae7ce78e59352817faf811c2337707e8de955d00f62b98fdd49d35f99a2f4
- Module hash: 175356c2118bde4ed4434f32b82a29bc6c6646e4050401b753821dc79f458edf
- https://github.com/dfinity/sdk/pull/3161
- https://github.com/dfinity/sdk/pull/3154
- https://github.com/dfinity/sdk/pull/3158

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pub struct Asset {
pub encodings: HashMap<String, AssetEncoding>,
pub max_age: Option<u64>,
pub headers: Option<HashMap<String, String>>,
pub is_aliased: Option<bool>,
pub enable_aliasing: Option<bool>,
pub allow_raw_access: Option<bool>,
}

Expand Down Expand Up @@ -310,7 +310,7 @@ impl State {
.into_iter()
.find_map(|alias_key| self.assets.get(&alias_key));
if let Some(asset) = aliased {
if asset.is_aliased.unwrap_or(DEFAULT_ALIAS_ENABLED) {
if asset.enable_aliasing.unwrap_or(DEFAULT_ALIAS_ENABLED) {
aliased
} else {
None
Expand Down Expand Up @@ -360,7 +360,7 @@ impl State {
encodings: HashMap::new(),
max_age: arg.max_age,
headers: arg.headers,
is_aliased: arg.enable_aliasing,
enable_aliasing: arg.enable_aliasing,
allow_raw_access: arg.allow_raw_access,
},
);
Expand Down Expand Up @@ -504,7 +504,7 @@ impl State {
let dependent_keys = self.dependent_keys(&arg.key);
let asset = self.assets.entry(arg.key.clone()).or_default();
asset.content_type = arg.content_type;
asset.is_aliased = arg.aliased;
asset.enable_aliasing = arg.aliased;

let hash = sha2::Sha256::digest(&arg.content).into();
if let Some(provided_hash) = arg.sha256 {
Expand Down Expand Up @@ -947,7 +947,7 @@ impl State {
max_age: asset.max_age,
headers: asset.headers.clone(),
allow_raw_access: asset.allow_raw_access,
is_aliased: asset.is_aliased,
is_aliased: asset.enable_aliasing,
})
}

Expand All @@ -969,7 +969,7 @@ impl State {
}

if let Some(is_aliased) = arg.is_aliased {
asset.is_aliased = is_aliased
asset.enable_aliasing = is_aliased
}

on_asset_change(&mut self.asset_hashes, &arg.key, asset, dependent_keys);
Expand All @@ -982,7 +982,7 @@ impl State {
if self
.assets
.get(key)
.and_then(|asset| asset.is_aliased)
.and_then(|asset| asset.enable_aliasing)
.unwrap_or(DEFAULT_ALIAS_ENABLED)
{
aliased_by(key)
Expand Down
Binary file modified src/distributed/assetstorage.wasm.gz
Binary file not shown.