Skip to content

Commit

Permalink
chore(sync-service): Fix append_to_log! spec (#1521)
Browse files Browse the repository at this point in the history
  • Loading branch information
robacourt authored Aug 14, 2024
1 parent a6b78f1 commit ea0b73f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/sync-service/lib/electric/shape_cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Electric.ShapeCacheBehaviour do
@moduledoc """
Behaviour defining the ShapeCache functions to be used in mocks
"""
alias Electric.LogItems
alias Electric.ShapeCache.Storage
alias Electric.Shapes.Shape
alias Electric.Replication.LogOffset
Expand All @@ -13,7 +14,7 @@ defmodule Electric.ShapeCacheBehaviour do
@callback append_to_log!(
shape_id(),
LogOffset.t(),
[Storage.prepared_change()],
[LogItems.log_item()],
keyword()
) :: :ok

Expand All @@ -28,6 +29,7 @@ end

defmodule Electric.ShapeCache do
require Logger
alias Electric.LogItems
alias Electric.Utils
alias Electric.ShapeCache.Storage
alias Electric.Shapes.Querying
Expand Down Expand Up @@ -87,7 +89,7 @@ defmodule Electric.ShapeCache do
@spec append_to_log!(
shape_id(),
LogOffset.t(),
[Storage.prepared_change()],
[LogItems.log_item()],
keyword()
) :: :ok
def append_to_log!(shape_id, latest_offset, relevant_changes, opts) do
Expand Down
6 changes: 3 additions & 3 deletions packages/sync-service/lib/electric/shape_cache/storage.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Electric.ShapeCache.Storage do
alias Electric.LogItem
alias Electric.LogItems
alias Electric.Shapes.Shape
alias Electric.Replication.LogOffset

Expand Down Expand Up @@ -60,7 +60,7 @@ defmodule Electric.ShapeCache.Storage do
@doc "Append log items from one transaction to the log"
@callback append_to_log!(
shape_id(),
[LogItem.t()],
[LogItems.log_item()],
compiled_opts()
) :: :ok
@doc "Get stream of the log for a shape since a given offset"
Expand Down Expand Up @@ -117,7 +117,7 @@ defmodule Electric.ShapeCache.Storage do
@doc """
Append log items from one transaction to the log
"""
@spec append_to_log!(shape_id(), [LogItem.t()], storage()) :: :ok
@spec append_to_log!(shape_id(), [LogItems.log_item()], storage()) :: :ok
def append_to_log!(shape_id, log_items, {mod, opts}),
do: mod.append_to_log!(shape_id, log_items, opts)

Expand Down

0 comments on commit ea0b73f

Please sign in to comment.