Pause instead of dangling when the live slide is deleted
CI / Deploy / test (push) Successful in 55s
CI / Deploy / deploy (push) Skipped

Deleting the live slide set current_slide_id directly, so participants saw
"not started", and deleting the paused slide left paused_slide_id pointing
to a slide that no longer exists. Poll::forgetSlide() now pauses and resumes
with the slide taking its place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 22:02:58 +01:00
1 parent 8b0e82d806
commit a7f9783a75
4 files changed
+75 -7

No files matched your search

+18
View File
@@ -99,6 +99,24 @@ class Poll extends Entity
$this->embed_seen_at = null;
}
/**
* A slide is being deleted. If it was live or is the one a pause resumes, the poll pauses
* and resumes with $resumeSlideId instead (null: no slides left = not started). Idempotent.
*
* @param int $slideId Deleted slide
* @param int|null $resumeSlideId Slide that takes its place (must belong to this poll)
* @return void
*/
public function forgetSlide(int $slideId, ?int $resumeSlideId): void
{
if ($this->current_slide_id !== $slideId && $this->paused_slide_id !== $slideId) {
return;
}
$this->current_slide_id = null;
$this->paused_slide_id = $resumeSlideId;
$this->embed_seen_at = null;
}
/**
* @return bool Paused after a slide had been live (not: not started yet)
*/