In my main actor file
stable let customerConfigurationStore = CustomerConfiguration.init();
// In CustomerConfiguration module...
// public func init() : Types.CustomerConfigurationStore
private type CustomerId = Principal;
// Map is from https://github.com/ZhenyaUsenko/motoko-hash-map
public type Map<K, V> = (
root: Entry<K, V>,
size: [var Nat32],
);
public type CustomerConfigurationStore = Map.Map<CustomerId, CustomerRecord>;
public type CustomerRecord = {
var email : ?CustomerEmail;
canisters : Map.Map<CanisterId, CanisterConfig>;
var customerNotifications : CustomerNotificationSettings;
createdTimestamp : ?Nat;
// <- I just added this, then attempted to re-deploy
var onboardingCompletedTimestamp : ?Nat;
};
I received the following warning on dfx deploy
Stable interface compatibility check failed for canister 'xxxx'.
Upgrade will either FAIL or LOSE some stable variable data.
(unknown location): Compatibility error [M0170], stable variable customerConfigurationStore of previous type
(Entry<CustomerId__2, CustomerRecord>, [var Nat32])
cannot be consumed at new type
(Entry__1<CustomerId__2__1, CustomerRecord__1>, [var Nat32])
Do you want to proceed? yes/No
Isn’t adding this property a subtype here?
var onboardingCompletedTimestamp : ?Nat;
The confusing part is that I could have sworn we’ve added additional fields to this type previously…for example, we added createdTimestamp : ?Nat;
last month with no issues (I just checked git blame
)