refactor: remove vestigial aliasing fields#75
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Removes the
enable_aliasing/aliased/is_aliasedfields 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.htmlfor 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
types.rs,assets.did): dropenable_aliasing(CreateAssetArguments),aliased(StoreArg/store), andis_aliased(AssetProperties,SetAssetPropertiesArguments,AssetDetails,list).state.rs): remove the threelet _ = arg.…ignore-shims and the twois_aliased: Noneplaceholder returns.stable.rs): drop the#[serde(default)] is_aliasedfield onStableAsset.state_hash.rs): dropenable_aliasingfrom the create-asset hash; remove the now-deadhash_opt_boolhelper andTAG_TRUE/TAG_FALSE.old_stable_assets_with_is_aliased_load_cleanlyround-trip test and the twoset_asset_propertiesblocks assertingis_aliasedwas ignored; strip the field literals; dropis_aliasedfrom the e2eAssetProperties. Rule-based aliasing tests are untouched.Verification
cargo test -p canister-core→ 98 passedcargo test -p sync-core→ 190 passedcargo test -p e2e→ 12 passed (live replica)cargo build -p canister,cargo fmt --check,cargo clippyall clean🤖 Generated with Claude Code