Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current release breaks with post-mid-December Electric because of Electric client version. #11

Open
thruflo opened this issue Jan 31, 2025 · 1 comment

Comments

@thruflo
Copy link

thruflo commented Jan 31, 2025

There was a breaking change to the offset format in electric-sql/electric#2119

This was fixed in the latest published Electric.Client, which is version 0.2.6-pre-1.

The :electric_client rep in the latest release here is:

{:electric_client, "~> 0.2.1"}

This means that Electric.Phoenix doesn't currently work when trying to stream data. The offset isn't valid, resulting in:

[error] GenServer {Electric.Client.Registry, {Electric.Client.Fetch.Request, {Electric.Client.Fetch.HTTP, "http://localhost:3000/v1/shape", "70014784-1738343408071", {0, 0}, false}}} terminating
** (ArgumentError) has invalid format
    (electric_client 0.2.5) lib/electric/client/offset.ex:57: Electric.Client.Offset.from_string!/1
    (electric_client 0.2.5) lib/electric/client/fetch/response.ex:33: Electric.Client.Fetch.Response.decode!/3
    (electric_client 0.2.5) lib/electric/client/fetch/http.ex:39: Electric.Client.Fetch.HTTP.wrap_resp/1
    (electric_client 0.2.5) lib/electric/client/fetch/request.ex:208: Electric.Client.Fetch.Request.handle_continue/2
    (stdlib 6.2) gen_server.erl:2335: :gen_server.try_handle_continue/3
    (stdlib 6.2) gen_server.erl:2244: :gen_server.loop/7
    (stdlib 6.2) proc_lib.erl:329: :proc_lib.init_p_do_apply/3
Last message: {:continue, :request}

This is a version publishing issue rather than a code issue. Is the problem because {:electric_client, "~> 0.2.1"} is pinned, or because the client was published with a -pre-1 suffix? Or do we need to trigger publishing this package when the client changes?

@thruflo
Copy link
Author

thruflo commented Jan 31, 2025

N.b.: this is currently workaroudable by just setting a specific electric_client version in your mix dept:

      {:electric_phoenix, "~> 0.2"},
      {:electric_client, "~> 0.2.6-pre-1"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant