Skip to content

Commit 067ddf6

Browse files
committed
Switch skip_session_data to send_session_data
The usage of the `skip_session_data` config option is now switched to `send_session_data`. The `appsignal-elixir` dependency is now locked to start from version `2.2.10` as it's the first one that sends the `send_session_data` config opt instead of `skip_session_data`.
1 parent 983c7fd commit 067ddf6

4 files changed

+12
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
bump: "patch"
3+
type: "change"
4+
---
5+
6+
Update the plug integration to listen to the `send_session_data` config option instead of
7+
`skip_session_data`. The `send_session_data` config option is backwards compatible with
8+
the `skip_session_data` config option.

lib/appsignal_plug.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ defmodule Appsignal.Plug do
184184
set_session_data(span, Application.get_env(:appsignal, :config), conn)
185185
end
186186

187-
defp set_session_data(span, %{skip_session_data: false}, %Plug.Conn{
187+
defp set_session_data(span, %{send_session_data: true}, %Plug.Conn{
188188
private: %{plug_session: session, plug_session_fetch: :done}
189189
}) do
190190
@span.set_sample_data(span, "session_data", session)

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ defmodule Appsignal.Plug.MixProject do
4545

4646
[
4747
{:plug, ">= 1.1.0"},
48-
{:appsignal, ">= 2.1.5 and < 3.0.0"},
48+
{:appsignal, ">= 2.2.10 and < 3.0.0"},
4949
{:credo, "~> 1.2", only: [:dev, :test], runtime: false},
5050
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
5151
{:ex_doc, "~> 0.21", only: :dev, runtime: false}

test/appsignal_plug_test.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,9 @@ defmodule Appsignal.PlugTest do
493493
refute sample_data("session_data", %{key: "value"})
494494
end
495495

496-
test "does not set session data when skip_session_data is set to true", %{span: span} do
496+
test "does not set session data when send_session_data is set to false", %{span: span} do
497497
config = Application.get_env(:appsignal, :config)
498-
Application.put_env(:appsignal, :config, %{config | skip_session_data: true})
498+
Application.put_env(:appsignal, :config, %{config | send_session_data: false})
499499

500500
try do
501501
Appsignal.Plug.set_conn_data(span, %Plug.Conn{

0 commit comments

Comments
 (0)