Skip to content

refactor: remove vestigial aliasing fields#75

Merged
lwshang merged 1 commit into
mainfrom
lwshang/remove_aliasing_fields
Jun 5, 2026
Merged

refactor: remove vestigial aliasing fields#75
lwshang merged 1 commit into
mainfrom
lwshang/remove_aliasing_fields

Conversation

@lwshang
Copy link
Copy Markdown
Collaborator

@lwshang lwshang commented Jun 5, 2026

What

Removes the enable_aliasing / aliased / is_aliased fields from the canister API and internals. These were accepted-but-ignored compatibility shims left over from the old built-in aliasing feature (auto-serving /foo.html for a request to /foo). That behavior is already gone — aliasing is now expressed explicitly as status-200 redirect rules in _redirects.

The sync-plugin (sync-core) never declared these fields in its own Candid types, so this is a no-behavior-change deletion of dead surface.

Changes

  • API (types.rs, assets.did): drop enable_aliasing (CreateAssetArguments), aliased (StoreArg/store), and is_aliased (AssetProperties, SetAssetPropertiesArguments, AssetDetails, list).
  • Logic (state.rs): remove the three let _ = arg.… ignore-shims and the two is_aliased: None placeholder returns.
  • Persistence (stable.rs): drop the #[serde(default)] is_aliased field on StableAsset.
  • Hashing (state_hash.rs): drop enable_aliasing from the create-asset hash; remove the now-dead hash_opt_bool helper and TAG_TRUE/TAG_FALSE.
  • Tests / e2e: delete the old_stable_assets_with_is_aliased_load_cleanly round-trip test and the two set_asset_properties blocks asserting is_aliased was ignored; strip the field literals; drop is_aliased from the e2e AssetProperties. Rule-based aliasing tests are untouched.

Verification

  • cargo test -p canister-core → 98 passed
  • cargo test -p sync-core → 190 passed
  • cargo test -p e2e → 12 passed (live replica)
  • cargo build -p canister, cargo fmt --check, cargo clippy all clean

🤖 Generated with Claude Code

enable_aliasing / aliased / is_aliased were accepted-but-ignored compat
shims left over from the old built-in aliasing feature, which is now
expressed as explicit status-200 redirect rules. The sync-plugin never
declared these fields, so removing them is a no-behavior-change deletion.

Drop the fields from the canister API (types.rs, assets.did), the
ignore-shims and placeholder `None` returns in state.rs, the serde compat
field on StableAsset, and the create-asset state hash (plus the now-dead
hash_opt_bool helper and its TAG_TRUE/TAG_FALSE constants). Strip them
from the unit tests and the e2e harness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lwshang lwshang marked this pull request as ready for review June 5, 2026 15:25
@lwshang lwshang requested a review from a team as a code owner June 5, 2026 15:25
@lwshang lwshang merged commit a94a9c7 into main Jun 5, 2026
6 checks passed
@lwshang lwshang deleted the lwshang/remove_aliasing_fields branch June 5, 2026 15:25
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