Skip to content

Jason Decode Error on sync_render transform/1 #114

@Jdyn

Description

@Jdyn

Getting these Jason decode errors while using sync_render tranform. It works locally with small amounts of items, but with ~10k items there may be a chunking issue?

      sync_render(conn, params, query,
        replica: :full,
        transform: fn
          %{"headers" => %{"operation" => "delete"}} = msg ->
            msg

          msg ->
            Map.update!(msg, "value", &Map.put(&1, "path", construct_full_url(&1)))
        end
      )
2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] 06:25:09.851 request_id=GG-B0ANU58ozmvoAASDx [error] ** (Jason.DecodeError) unexpected byte at position 0: 0x28 ("(")

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (jason 1.4.4) lib/jason.ex:92: Jason.decode!/2

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (phoenix_sync 0.6.0) lib/phoenix/sync/electric.ex:607: Phoenix.Sync.Electric.map_response_body/2

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (phoenix_sync 0.6.0) lib/phoenix/sync/electric/client_adapter.ex:64: Phoenix.Sync.Adapter.PlugApi.Phoenix.Sync.Electric.ClientAdapter.fetch_upstream/4

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (myapp 0.1.0) lib/web/controllers/sync/case_controller.ex:1: MyApp.Sync.CaseController.action/2

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (myapp 0.1.0) lib/web/controllers/sync/case_controller.ex:1: MyApp.Sync.CaseController.phoenix_controller_pipeline/2

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (phoenix 1.8.1) lib/phoenix/router.ex:416: Phoenix.Router.__call__/5

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (myapp 0.1.0) lib/web/endpoint.ex:1: MyApp.Endpoint.plug_builder_call/2

2025-10-18T06:25:09.851 app[2860310b6077e8] sjc [info] (myapp 0.1.0) lib/web/endpoint.ex:1: MyApp.Endpoint.call/2

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