Publish podcast cards only after the first device sync

A device restarted with a "share" decision that another device of its
group revoked meanwhile sent that card again: the first reconciler pass
called sync_shares from the stale registers before device sync ran.
Until DeviceSync says the registers are current (a sync exchange with a
v4 device of the group after the store was attached, or no such device
to wait for), passes now only unpublish cards the local registers no
longer share and never call sync_shares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
sanapachandClaude Opus 5.5 committed 2026-11-20 15:13:07 +02:00
1 parent ce5697ce1d
commit 409188b9a9
11 files changed
+522 -37

No files matched your search

+10
View File
@@ -213,6 +213,16 @@ mod tests {
let screen = render(&state, 110, 30);
assert!(screen.contains("held back"), "{screen}");
// Restarted with other devices in the group: not published before
// a sync with one of them.
state.podcasts.publication.podcasts.insert(
podcast_fixtures::podcast_id(),
Publication::WaitingForDevices,
);
let screen = render(&state, 110, 30);
assert!(screen.contains("waiting for a sync"), "{screen}");
assert!(!screen.contains("published from"), "{screen}");
state.podcasts.publication.discovery = Discovery::Off("federation is off".into());
let screen = render(&state, 110, 30);
assert!(screen.contains("not published:"), "{screen}");
+4
View File
@@ -351,6 +351,10 @@ pub(crate) fn share_status_line(state: &AppState, podcast: &PodcastRow) -> Line<
"shared · published from this device".to_string(),
theme::accent_for(state),
),
(_, Some(Publication::WaitingForDevices)) => (
"shared · not published yet: waiting for a sync with your other devices".to_string(),
theme::dim(),
),
(Discovery::Starting, _) | (_, Some(Publication::Pending) | None) => {
return loading_line(state, "shared · publishing…");
}