mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-28 21:50:26 +08:00
Similar to the `Fetcher` sans-IO approach, an `Announcer` sans-IO approach is introduced. The previous `Handler::announce` was already quite close to using a sans-IO approach, but using internally held state. This change makes the business logic more reusable – and testable. Similarly to the `Fetcher`, the `Announcer` is configured and then driven by telling it when nodes have been synchronized with. It will continuously check if it has reached its target, yielding to the caller to decide whether to keep going. In contrast, it also provides a way to mark the process as timed out, since announcing relies on waiting for events to come back in a timely manner.
2.3 KiB
2.3 KiB
In some cases, a peer can create references, which includes rad/sigrefs,
without having pushed the canonical default branch. For example, Bob can create
an issue in the repository:
$ rad issue open --title "Add Bob as a delegate" --description "We agreed to add me as a delegate, so I am creating an issue to track that work" --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
╭──────────────────────────────────────────────────────────────╮
│ Title Add Bob as a delegate │
│ Issue f12d512c51d30429f7916db038ae0360e2e938c2 │
│ Author bob (you) │
│ Status open │
│ │
│ We agreed to add me as a delegate, so I am creating an issue │
│ to track that work │
╰──────────────────────────────────────────────────────────────╯
✓ Synced with 1 seed(s)
and if we inspect Alice's references, then we will see the following:
$ rad inspect --refs
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
└── refs
├── cobs
│ └── xyz.radicle.id
│ └── 0656c217f917c3e06234771e9ecae53aba5e173e
├── heads
│ └── master
└── rad
├── id
├── root
└── sigrefs
z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
└── refs
├── cobs
│ └── xyz.radicle.issue
│ └── f12d512c51d30429f7916db038ae0360e2e938c2
└── rad
├── root
└── sigrefs
Despite not having the canonical branch, Alice should still be able to add Bob as a delegate, since a threshold of 1 can still be reached:
$ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delegate did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk -q
7be665f9fccba97abb21b2fa85a6fd3181c72858