electric-sql / electric

Sync little subsets of your Postgres data into local apps and services.
https://electric-sql.com
Apache License 2.0
6.2k stars 146 forks source link

no function clause matching in Electric.Satellite.ClientReconnectionInfo.unsubscribe/4 #1403

Closed barrelltech closed 1 month ago

barrelltech commented 3 months ago

I synced down a bunch of medias rows, then on the backend ran a migration adding medias.popularity. When I updated my sync shape to go from all medias to {where: {popularity: {lte: 12}}}, I got this issue on the server:

12:02:57.587 pid=<0.3794.0> client_id=b05ec15d-0a60-41bc-a892-4a402044ec2c instance_id=541042b6-5b5b-4af7-9c73-227208fdc5c6 user_id=c118f849-bfdd-488a-9fca-2dfd7e93a170 [error] ** (FunctionClauseError) no function clause matching in Electric.Satellite.ClientReconnectionInfo.unsubscribe/4
    (electric 0.12.0) lib/electric/satellite/client_reconnection_info.ex:836: Electric.Satellite.ClientReconnectionInfo.unsubscribe("postgres_1", "b05ec15d-0a60-41bc-a892-4a402044ec2c", [], 651227080)
    (electric 0.12.0) lib/electric/satellite/protocol.ex:272: Electric.Satellite.Protocol.handle_rpc_request/2
    (electric 0.12.0) lib/electric/satellite/protocol.ex:339: Electric.Satellite.Protocol.process_message/2
    (electric 0.12.0) lib/electric/satellite/ws_server.ex:107: Electric.Satellite.WebsocketServer.process_message/2
    (bandit 1.1.3) lib/bandit/websocket/connection.ex:79: Bandit.WebSocket.Connection.handle_frame/3
    (bandit 1.1.3) lib/bandit/websocket/handler.ex:52: anonymous fn/3 in Bandit.WebSocket.Handler.handle_data/3
    (elixir 1.16.1) lib/stream.ex:1759: Stream.do_unfold/4
    (elixir 1.16.1) lib/enum.ex:2582: Enum.reduce_while/3

While handling message from the client:
  %Electric.Satellite.SatRpcRequest{
    method: "unsubscribe",
    request_id: 36,
    message: <<10, 29, 99, 56, 99, 104, 77, 113, 50, 73, 85, 73, 58, 103, 108,
      111, 98, 97, 108, 45, 112, 114, 101, 102, 101, 114, 101, 110, 99, 101, 115,
      10, 27, 110, 84, 76, 117, 55, 68, 68, 52, 53, 53, 58, 103, 108, 111, ...>>
  }"

12:02:57.587 pid=<0.3794.0> client_id=b05ec15d-0a60-41bc-a892-4a402044ec2c instance_id=541042b6-5b5b-4af7-9c73-227208fdc5c6 user_id=c118f849-bfdd-488a-9fca-2dfd7e93a170 [error] GenServer #PID<0.3794.0> terminating
** (stop) %FunctionClauseError{module: Electric.Satellite.ClientReconnectionInfo, function: :unsubscribe, arity: 4, kind: nil, args: nil, clauses: nil}
Last message: {:tcp, #Port<0.53>, <<130, 254, 0, 226, 67, 125, 141, 208, 86, 119, 134, 165, 45, 14, 248, 178, 48, 30, 255, 185, 33, 24, 157, 244, 89, 178, 140, 218, 94, 30, 181, 179, 43, 48, 252, 226, 10, 40, 196, 234, 36, 17, 226, 178, 34, 17, 160, ...>>}

I regenerated the client, no success. I swapped databases (changed the name of the indexeddb) and everything worked.

Just wanted to raise this error

linear[bot] commented 3 months ago

VAX-1993 no function clause matching in Electric.Satellite.ClientReconnectionInfo.unsubscribe/4

KyleAMathews commented 1 month ago

👋 we've been working the last month on a rebuild of the Electric server over at a temporary repo https://github.com/electric-sql/electric-next/

You can read more about why we made the decision at https://next.electric-sql.com/about

We're really excited about all the new possibilities the new server brings and we hope you'll check it out soon and give us your feedback.

We're now moving the temporary repo back here. As part of that migration we're closing all the old issues and PRs. We really appreciate you taking the time to investigate and report this issue!