Revoke podcast cards promptly and report unrevoked ones
Turning sharing off or unsubscribing runs a reconciler pass right away, and quitting waits up to 4 s for it. The Podcasts tab tells a private podcast whose card from this device is still live, failed revocations are reported without ids, the overlay peer count stays current, and the reconciler loop is tested against a loopback overlay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a51f5552e3
commit
1137670229
6 files changed
+423
-35
No files matched your search
@@ -216,6 +216,33 @@ mod tests {
|
||||
state.podcasts.publication.discovery = Discovery::Off("federation is off".into());
|
||||
let screen = render(&state, 110, 30);
|
||||
assert!(screen.contains("not published:"), "{screen}");
|
||||
|
||||
// Sharing turned off here: until a pass revoked the card, the panel
|
||||
// does not claim the podcast is simply private.
|
||||
state.podcasts.publication.discovery = Discovery::Running { peers: 2 };
|
||||
state
|
||||
.podcasts
|
||||
.publication
|
||||
.podcasts
|
||||
.insert(podcast_fixtures::podcast_id(), Publication::Published);
|
||||
state
|
||||
.podcasts
|
||||
.publication
|
||||
.note_revocation(&podcast_fixtures::podcast_id());
|
||||
let screen = render(&state, 110, 30);
|
||||
assert!(screen.contains("private · revoking the"), "{screen}");
|
||||
if let Some(crate::app::state::Loadable::Ready(rows)) = &mut state.podcasts.list {
|
||||
rows[0].summary.shared = false;
|
||||
}
|
||||
let screen = render(&state, 110, 30);
|
||||
assert!(screen.contains("private · revoking the"), "{screen}");
|
||||
assert!(!screen.contains("private (not shared"), "{screen}");
|
||||
state.podcasts.publication.discovery = Discovery::Off("federation is off".into());
|
||||
let screen = render(&state, 110, 30);
|
||||
assert!(screen.contains("not revoked yet:"), "{screen}");
|
||||
state.podcasts.publication.unrevoked.clear();
|
||||
let screen = render(&state, 110, 30);
|
||||
assert!(screen.contains("private (not shared"), "{screen}");
|
||||
}
|
||||
|
||||
/// Search view with a federated artist and two public podcast cards;
|
||||
|
||||
+18
-3
@@ -313,10 +313,25 @@ pub(crate) fn share_status_line(state: &AppState, podcast: &PodcastRow) -> Line<
|
||||
if tab.share_busy.contains(podcast.id()) {
|
||||
return loading_line(state, "saving the share setting…");
|
||||
}
|
||||
if !podcast.summary.shared {
|
||||
return Line::styled("private (not shared in the federation)", theme::dim());
|
||||
}
|
||||
let report = &tab.publication;
|
||||
// A card from this device that is still live although the podcast is
|
||||
// private now (revocation pending, failed, or federation off).
|
||||
let unrevoked = report.unrevoked.contains(podcast.id());
|
||||
if !podcast.summary.shared || (unrevoked && !report.podcasts.contains_key(podcast.id())) {
|
||||
if !unrevoked {
|
||||
return Line::styled("private (not shared in the federation)", theme::dim());
|
||||
}
|
||||
if let Discovery::Off(_) = report.discovery {
|
||||
return Line::styled(
|
||||
"private · public card not revoked yet: federation is off",
|
||||
Style::new().fg(Color::Yellow),
|
||||
);
|
||||
}
|
||||
return loading_line(
|
||||
state,
|
||||
"private · revoking the public card from this device…",
|
||||
);
|
||||
}
|
||||
let (text, style) = match (&report.discovery, report.podcasts.get(podcast.id())) {
|
||||
(Discovery::Off(reason), _) => (format!("shared · not published: {reason}"), theme::dim()),
|
||||
(_, Some(Publication::HeldBack(_))) => (
|
||||
|
||||
Reference in new issue
Block a user