Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Role and cell clone naming not documented or very clear #222

Open
nphias opened this issue Jan 19, 2024 · 3 comments
Open

Role and cell clone naming not documented or very clear #222

nphias opened this issue Jan 19, 2024 · 3 comments

Comments

@nphias
Copy link

nphias commented Jan 19, 2024

indexing of clones. (rolename:integer) to make a "clone_id" is undocumented and a bit unclear
I think it would be useful to have a common unique field which abstracts above all cell types (stem, clone, provisioned)
to reflect a role instance (useful for DX in the UI eg dynamic store creation) . It could be just rolename.
the exisiting "name" field in all cells could continue to be used for user defined (optional) application logic
for example:

export interface StemCell {
    dna: DnaHash;
    name?: string;
    dna_modifiers: DnaModifiers;
    -> rolename: string
}
/**
 * @public
 */
export interface ProvisionedCell {
    cell_id: CellId;
    dna_modifiers: DnaModifiers;
    name?: string;
    -> rolename: string
}
/**
 * @public
 */
export interface ClonedCell {
    cell_id: CellId;
    clone_id: RoleName; -> rolename: string
    original_dna_hash: DnaHash;
    dna_modifiers: DnaModifiers;
    name?: string;
    enabled: boolean;
}
@nphias
Copy link
Author

nphias commented Jan 19, 2024

related to closed issue: #161

@jost-s
Copy link
Contributor

jost-s commented Jan 22, 2024

Yeah, it's not well documented. As a developer you don't create clone ids. And using them only makes sense for local calls, because you cannot know the clone id of a specific clone cell in other conductors. The only reliable way of making remote calls is using the cell id.

The clone index is given by the conductor. It cannot be set by the developer. You could have a rolename as the clone id as you suggest, but it wouldn't be different from name.

@mattyg
Copy link
Member

mattyg commented Jul 24, 2024

I'm working with clone cells after a long hiatus. With fresh eyes, I'm remembering how painful I found the ergonomics:

  1. Its weird that for a provisioned cell, the field is role_name, but for a clone cell the field is clone_id, even though they seem to be the same?
  2. It's painful to have to conditionally check if your cell is CellType.Provisioned or CellType.Cloned every time you want to use any data within it. I would love to move all the common fields up to a higher-level object. I.e.
interface Cell {
  cell_id: CellId;
  name: string;
  role_name: string;
  dna_modifiers; DnaModifiers
  cell_type: CellType;
  cell_type_details: StemCell | ProvisionedCell | ClonedCell
}

  1. Serde has an option to include the enum type as a separate field. We should use that for the cell type.

This should probably be changed in the holochain repo rather than the client lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants