Skip to content

Commit

Permalink
chore: more renamings from shape id -> shape handle (#1972)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews authored Nov 19, 2024
1 parent 1497be2 commit 9d5933a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/elixir-client/lib/electric/client/stream.ex
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ defmodule Electric.Client.Stream do
# deleted. We should start from scratch, this will force the shape to be
# recreated
# 409: Upon receiving a 409, we should start from scratch with the newly
# provided shape ID
# provided shape handle
defp handle_response({:error, %Fetch.Response{status: status} = resp}, stream)
when status in [400, 409] do
%{value_mapper_fun: value_mapper_fun} = stream
Expand Down
4 changes: 2 additions & 2 deletions packages/sync-service/lib/electric/plug/serve_shape_plug.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ defmodule Electric.Plug.ServeShapePlug do
@must_refetch Jason.encode!([%{headers: %{control: "must-refetch"}}])
@shape_definition_mismatch Jason.encode!(%{
message:
"The specified shape definition and ID do not match. " <>
"Please ensure the shape definition is correct or omit the shape ID from the request to obtain a new one."
"The specified shape definition and handle do not match. " <>
"Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one."
})

defmodule Params do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ defmodule Electric.ShapeCache.FileStorage do
:ok

{:error, :eexist} ->
# file already exists - by virtue of the shape ID being the hash of the
# file already exists - by virtue of the shape handle being the hash of the
# definition we do not need to compare them
:ok

Expand Down
2 changes: 1 addition & 1 deletion packages/sync-service/test/electric/plug/router_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ defmodule Electric.Plug.RouterTest do
assert conn.resp_body ==
Jason.encode!(%{
message:
"The specified shape definition and ID do not match. Please ensure the shape definition is correct or omit the shape ID from the request to obtain a new one."
"The specified shape definition and handle do not match. Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one."
})
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,8 @@ defmodule Electric.Plug.ServeShapePlugTest do

assert Jason.decode!(conn.resp_body) == %{
"message" =>
"The specified shape definition and ID do not match." <>
" Please ensure the shape definition is correct or omit the shape ID from the request to obtain a new one."
"The specified shape definition and handle do not match." <>
" Please ensure the shape definition is correct or omit the shape handle from the request to obtain a new one."
}
end

Expand Down

0 comments on commit 9d5933a

Please sign in to comment.