+
Skip to content

Add owner/creator to LinearState to allow ordering by "mine" records first #7139

@adamturski

Description

@adamturski

LinearState has a list of participants which will be automatically notified about changes etc.
Let's say that I have 2 nodes and on both nodes I created 2 states and shared them between nodes, by adding both parties on their participants list, for example:
PARTY_A: state1 (PARTY_A, PARTY_B)
PARTY_B: state2 (PARTY_B, PARTY_A)
PARTY_A: state3 (PARTY_A, PARTY_B)
PARTY_B: state4 (PARTY_B, PARTY_A)

let's say that states implement PersistableState, meaning that in DB both nodes has vault_states records [state1, state2, state3, state4].

My need is now to get all RELEVANT (where my party is on participants list) states but order them by putting mine records first, e.g.
state1 (originally created by PARTY_A)
state3 (originally created by PARTY_A)
state2 (originally created by PARTY_B)
state4 (originally created by PARTY_B)

How can I achieve that? Is it even possible? I was able to achieve that but my solution looks hacky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载