Skip to content

Client hangs when using FSharpPlus.Data.NonEmptySeq #371

@madyanalj

Description

@madyanalj

When using NonEmptySeq or NonEmptyList from FSharpPlus.Data in the response type, the client gets stuck in the loading state.

Example

type IApi = {
    test: unit -> Async<NonEmptySeq<string>>
}
let update msg model =
    match msg with
    | LoadBookings msg ->
        match msg with
        | Start() ->
            let cmd = Cmd.OfAsync.perform api.test () (Finished >> LoadBookings)

            { model with Bookings = Loading }, cmd
        | Finished bookingsPage ->
            printfn "bookingsPage: %A" bookingsPage // THIS NEVER GETS TRIGGERED
            { model with Bookings = Loaded(bookingsPage) }, Cmd.none

The frontend does the start command to trigger the request. The request succeeds and responds with:

["Hello","World"]

However, the frontend Finished command never gets triggered, and no error seem to be logged.

If I change the type to a native seq it works again.

Is this a bug? (newbie here, could be missing something)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions