You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
By adding a new field to an error variant, I get back an error Cannot find field hash _2102411630_ when using a version of the generated delcarations without the new variant.
To Reproduce
Deploy canister with type
public type CreateInvoiceErr = {
message : ?Text;
kind : {
#BadSize;
#InvalidToken;
#InvalidAmount;
#InvalidDestination;
#InvalidDetails;
#MaxInvoicesReached;
#Other;
};
};
Generate declarations
Add type #NotAuthorized;
Redeploy, and make call using prior declarations
Expected behavior
Agent JS should make the call without the most up to date interface
The text was updated successfully, but these errors were encountered:
With the current implementation, I think we won't get the error unless you are sending the new tag #NotAuthorized as the value.
With the new spec change, the error variant should also be inside an opt value, so that when the client sees an unknown tag, we change it to null. See dfinity/candid#295. This has not been implemented in JS yet.
I'm getting the error when receiving the new tag from the canister. Could we switch to a console.warn approach, while allowing the application logic to decide how to handle the unexpected tag?
Describe the bug
By adding a new field to an error variant, I get back an error
Cannot find field hash _2102411630_
when using a version of the generated delcarations without the new variant.To Reproduce
#NotAuthorized;
Expected behavior
Agent JS should make the call without the most up to date interface
The text was updated successfully, but these errors were encountered: