Skip to content

Receiver notify empty#1200

Merged
StaehliJ merged 11 commits intomainfrom
receiver-notify-empty
Jan 12, 2026
Merged

Receiver notify empty#1200
StaehliJ merged 11 commits intomainfrom
receiver-notify-empty

Conversation

@StaehliJ
Copy link
Contributor

Description

The goal of this PR is to seperate the responsability threw different classes and to fix sending an empty queue when it is not the truth.

Changes made

  • Add LogMediaStatusInterceptor to log the MediaStatus that will be send to senders. Only available in debug.

Checklist

  • APIs have been properly documented (if relevant).
  • The documentation has been updated (if relevant).
  • New unit tests have been written (if relevant).
  • The demo has been updated (if relevant).

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Pillarbox Oct 22, 2025
@StaehliJ StaehliJ moved this from 📋 Backlog to 🍿 Code Review in Pillarbox Oct 22, 2025
@StaehliJ StaehliJ requested a review from waliid October 22, 2025 09:36
@github-actions
Copy link

github-actions bot commented Oct 22, 2025

Code Coverage

Overall Project 46.6% -5.78% 🟢
Files changed 0% 🟢

Module Coverage
:pillarbox-cast 28.72% -4.86% 🟢
:pillarbox-cast-receiver 1.82% -84.59% 🟢
Files
Module File Coverage
:pillarbox-cast PillarboxCastPlayer.kt 1.05% -6.05% 🟢
MediaQueueTracker.kt 0% -28.17% 🟢
:pillarbox-cast-receiver MediaQueueManager.kt 0% 🟢
MediaCommandCallbackImpl.kt 0% 🟢
MediaLoadCommandCallbackImpl.kt 0% 🟢
LogMediaStatusInterceptor.kt 0% 🟢
PillarboxCastReceiverPlayer.kt 0% -51.32% 🟢
PlayerListener.kt 0% 🟢

@waliid
Copy link
Member

waliid commented Oct 23, 2025

Thanks for this PR. It seems to fix the weird issue with the empty queue.
However, I found another issue that occurs when deleting the current item while it's located at the end of the queue.
Let me explain how to reproduce it:

  • Load several items (URNs)
  • Select the last item
  • Delete the last item

Current behavior

The iOS sender queue still contains elements, but none of them can be selected.

Expected behavior

One of the following behaviors could be expected.

Options
1 The queue is cleared and playback stops, as on the Web Receiver.
2 The queue isn't cleared. The last remaining item in the queue is selected and playback continues.

@JordanMontel JordanMontel moved this from 🍿 Code Review to 🚧 In Progress in Pillarbox Dec 1, 2025
@StaehliJ StaehliJ force-pushed the receiver-notify-empty branch from acc4fdf to f83971d Compare December 8, 2025 12:43
@StaehliJ
Copy link
Contributor Author

StaehliJ commented Dec 15, 2025

Android sender doesn't have the issue and it receive the following events

  • itemsReloaded with an empty MediaQueue
  • mediaQueueChanged with an empty MediaQueue

And the following status update

  • onStatusUpdated playerState = PLAYER_STATE_IDLE idleReason = IDLE_REASON_FINISHED

@waliid
Copy link
Member

waliid commented Dec 15, 2025

On iOS, the issue is related to the event received from the receiver mediaQueueDidReloadItems.
When the last item is selected and deleted on the iOS sender, two consecutive events are received.
One with an empty array, and another with the array still containing the deleted item. Since the last event indicates that the queue is not empty, the playlist does not get cleared.

@StaehliJ StaehliJ added this pull request to the merge queue Jan 12, 2026
@StaehliJ StaehliJ moved this from 🚧 In Progress to 🍿 Code Review in Pillarbox Jan 12, 2026
Merged via the queue into main with commit eb35308 Jan 12, 2026
13 checks passed
@StaehliJ StaehliJ deleted the receiver-notify-empty branch January 12, 2026 10:06
@github-project-automation github-project-automation bot moved this from 🍿 Code Review to ✅ Done in Pillarbox Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants