Skip to content

[BUG] [iOS] Playlist item build failures are silently discarded by try? #250

Open

Description

@simon-wexer

Describe the bug

In the playlist-only setConfig branch (ios/RNJWPlayer/RNJWPlayerView.swift):

if let playerItem = try? getPlayerItem(item: item as! [String: Any]) {
    playlistArray.append(playerItem)
}

The try? discards the error. A malformed item is dropped with no signal to JS — no event, no warning, no count. The resulting playlistArray may be partially or entirely empty, and loadPlaylist is then called with it, indistinguishable from success.

Expected behavior

An item that fails to build should be observable from the React Native side — e.g. an onPlayerWarning per dropped item carrying the underlying error, and/or a count of items actually loaded.

Impact / why this matters

This directly cost us investigation time on #248. We could not exclude "the array arrived empty" as the cause without reading the module's Swift source, because nothing about the failure is observable from JS.

For a library where the playlist is supplied from application state, silent partial loading is a difficult class of bug to diagnose from the consumer side.

Additional context

Unchanged in 1.7.0 and on main. Related: #248, and #115 where item construction was rejecting valid input.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions