Skip to content

Conversation

aterga
Copy link
Member

@aterga aterga commented Sep 24, 2025

Motivation

This is the first step towards supporting the new concept of default accounts. The FE needs a way to distinguish default and non-default accounts associates with a (identity, application) pair.

Changes

Add the is_default to the Candid API and propagate it through the Rust types. For now, we keep the value set to None in all places.

Tests

Existing CI tests should suffice.

@aterga aterga marked this pull request as ready for review September 24, 2025 09:33
@aterga aterga requested review from sea-snake, lmuntaner and danblackadder and removed request for sea-snake September 24, 2025 09:33
last_used : opt Timestamp;
// Configurable properties
name : opt text;
is_default : opt bool;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danblackadder, this is how the FE can tell which account is the default.

In case this field is null, I suggest assuming that the default account = the primary account.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to set it as optional? I don't think we need to keep backwards compatibility.

pub origin: FrontendHostname,
pub last_used: Option<Timestamp>,
pub name: Option<String>,
pub is_default: Option<bool>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it need to be an Option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding all new record fields as optional is the recommended way to extend a Candid API.

Since the II has been developed in a special way (with BE and FE changes being synchronized), I've explored also the alternative of adding the field as non-optional, see here

We should discuss which approach to follow (I'm still leaning towards optional fields).

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.

2 participants