Permalink
Browse files

Merge branch 'releases/v0.17.0'

  • Loading branch information...
slashdotdash committed Nov 9, 2018
2 parents a2af8f7 + b72720e commit 1d48672f84ae2c0c92744f3901a2e06ee38316b7
@@ -53,6 +53,12 @@
end
```
## v0.17.2
### Enhancements
- Remove default `error/4` callback function from process manager to silence deprecation warning.
## v0.17.1
### Enhancements
@@ -283,13 +283,7 @@ defmodule Commanded.ProcessManagers.ProcessManager do
def apply(process_manager, _event), do: process_manager
@doc false
def error({:error, reason}, failed, %{pending_commands: pending, context: context}) do
error({:error, reason}, failed, pending, context)
end
@doc false
def error({:error, reason}, _failed_command, _pending_commands, _context),
do: {:stop, reason}
def error({:error, reason}, _command, _failure_context), do: {:stop, reason}
end
end
end
@@ -1,7 +1,7 @@
defmodule Commanded.Mixfile do
use Mix.Project
@version "0.17.1"
@version "0.17.2"
def project do
[
@@ -9,6 +9,6 @@
"mix_test_watch": {:hex, :mix_test_watch, "0.9.0", "c72132a6071261893518fa08e121e911c9358713f62794a90c95db59042af375", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm"},
"mox": {:hex, :mox, "0.4.0", "7f120840f7d626184a3d65de36189ca6f37d432e5d63acd80045198e4c5f7e6e", [:mix], [], "hexpm"},
"nimble_parsec": {:hex, :nimble_parsec, "0.4.0", "ee261bb53214943679422be70f1658fff573c5d0b0a1ecd0f18738944f818efe", [:mix], [], "hexpm"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.0", "d55e25ff1ff8ea2f9964638366dfd6e361c52dedfd50019353598d11d4441d14", [:mix], [], "hexpm"},
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"},
"poison": {:hex, :poison, "4.0.1", "bcb755a16fac91cad79bfe9fc3585bb07b9331e50cfe3420a24bcc2d735709ae", [:mix], [], "hexpm"},
}
@@ -1,7 +1,11 @@
defmodule Commanded.ProcessManager.ProcessManagerErrorHandlingTest do
use Commanded.StorageCase
alias Commanded.ProcessManagers.{ErrorHandlingProcessManager, ErrorRouter}
alias Commanded.ProcessManagers.{
DefaultErrorHandlingProcessManager,
ErrorHandlingProcessManager,
ErrorRouter
}
alias Commanded.ProcessManagers.ErrorAggregate.Commands.{
RaiseError,
@@ -77,7 +81,7 @@ defmodule Commanded.ProcessManager.ProcessManagerErrorHandlingTest do
assert_receive {:error, :too_many_attempts, %{attempts: 3}}
# should shutdown process router
assert_receive {:DOWN, ^ref, _, _, _}
assert_receive {:DOWN, ^ref, :process, ^process_router, :too_many_attempts}
end
test "should retry command with specified delay between attempts" do
@@ -102,7 +106,7 @@ defmodule Commanded.ProcessManager.ProcessManagerErrorHandlingTest do
assert_receive {:error, :too_many_attempts, %{attempts: 3}}
# should shutdown process router
assert_receive {:DOWN, ^ref, _, _, _}
assert_receive {:DOWN, ^ref, :process, ^process_router, :too_many_attempts}
end
test "should skip the event when error reply is `{:skip, :continue_pending}`" do
@@ -149,15 +153,15 @@ defmodule Commanded.ProcessManager.ProcessManagerErrorHandlingTest do
process_uuid = UUID.uuid4()
command = %StartProcess{process_uuid: process_uuid, reply_to: reply_to()}
{:ok, process_router} = ErrorHandlingProcessManager.start_link()
{:ok, process_router} = DefaultErrorHandlingProcessManager.start_link()
Process.unlink(process_router)
ref = Process.monitor(process_router)
assert :ok = ErrorRouter.dispatch(command)
# should shutdown process router
assert_receive {:DOWN, ^ref, _, _, _}
assert_receive {:DOWN, ^ref, :process, ^process_router, :failed}
refute Process.alive?(process_router)
end
end
@@ -1,20 +1,13 @@
defmodule Commanded.ProcessManagers.DefaultErrorHandlingProcessManager do
@moduledoc false
alias Commanded.ProcessManagers.{
DefaultErrorHandlingProcessManager,
ExampleRouter,
}
alias Commanded.ProcessManagers.ErrorAggregate.Commands.{
AttemptProcess,
}
alias Commanded.ProcessManagers.ErrorAggregate.Events.{
ProcessStarted,
}
alias Commanded.ProcessManagers.{DefaultErrorHandlingProcessManager, ErrorRouter}
alias Commanded.ProcessManagers.ErrorAggregate.Commands.AttemptProcess
alias Commanded.ProcessManagers.ErrorAggregate.Events.ProcessStarted
use Commanded.ProcessManagers.ProcessManager,
name: "DefaultErrorHandlingProcessManager",
router: ExampleRouter
router: ErrorRouter
defstruct [:process_uuid]

0 comments on commit 1d48672

Please sign in to comment.