chore(deps): upgrade live_stash 0.1.2 → 0.2.0

Two breaking API changes in 0.2:

- `stash_assigns/2` is gone. Keys to persist are now declared on the
  `use LiveStash, stored_keys: [...]` macro and `stash/1` picks them
  up automatically.
- The TTL unit switched to seconds — this codebase never called the
  TTL setter, so no config change is needed.

Updated both callers (MapLive persists selected_band + selected_time;
SubmitLive persists active_tab). `recover_state/1` signature is
unchanged. Full LiveView suite passes (67 tests).
This commit is contained in:
Graham McIntire 2026-04-23 13:56:08 -05:00
parent ed21758557
commit 75ec3f8d1e
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
4 changed files with 9 additions and 8 deletions

View file

@ -1,7 +1,7 @@
defmodule MicrowavepropWeb.MapLive do
@moduledoc "`/map` — main propagation heatmap with forecast timeline + point detail drawer."
use MicrowavepropWeb, :live_view
use LiveStash
use LiveStash, stored_keys: [:selected_band, :selected_time]
alias Microwaveprop.Propagation
alias Microwaveprop.Propagation.BandConfig
@ -50,8 +50,9 @@ defmodule MicrowavepropWeb.MapLive do
|> assign(:pipeline_status, PipelineStatus.current())
|> assign(:pipeline_progress, nil)
# LiveStash only persists the keys passed to `stash_assigns/2`
# (selected_band + selected_time). On reconnect the recovered socket has
# LiveStash only persists the keys declared in `use LiveStash,
# stored_keys: [...]` (selected_band + selected_time). On reconnect
# the recovered socket has
# just those — the rest of the mount-time assigns (bands, bounds, the
# initial score JSON payload, toggles, etc.) have to be rebuilt or the
# first render crashes with KeyError on :initial_scores_json.
@ -231,7 +232,7 @@ defmodule MicrowavepropWeb.MapLive do
socket
|> assign(selected_band: band, valid_times: valid_times, selected_time: selected_time)
|> assign(:tracking_now?, tracking_now?(selected_time, valid_times, DateTime.utc_now()))
|> LiveStash.stash_assigns([:selected_band, :selected_time])
|> LiveStash.stash()
|> push_event("update_scores", %{scores: Propagation.pack_scores(scores)})
|> push_event("update_band_info", %{band_info: band_info(band)})
|> push_timeline()

View file

@ -1,7 +1,7 @@
defmodule MicrowavepropWeb.SubmitLive do
@moduledoc "`/submit` QSO submission form; enqueues enrichment jobs on save."
use MicrowavepropWeb, :live_view
use LiveStash
use LiveStash, stored_keys: [:active_tab]
alias Microwaveprop.Propagation.BandConfig
alias Microwaveprop.Radio
@ -57,7 +57,7 @@ defmodule MicrowavepropWeb.SubmitLive do
@impl true
def handle_event("switch_tab", %{"tab" => tab}, socket) do
socket = assign(socket, active_tab: String.to_existing_atom(tab))
{:noreply, LiveStash.stash_assigns(socket, [:active_tab])}
{:noreply, LiveStash.stash(socket)}
end
def handle_event("validate", %{"contact" => contact_params}, socket) do

View file

@ -62,7 +62,7 @@ defmodule Microwaveprop.MixProject do
{:phoenix_live_view, "~> 1.1.0"},
{:lazy_html, ">= 0.1.0", only: :test},
{:stream_data, "~> 1.0", only: :test},
{:live_stash, "~> 0.1"},
{:live_stash, "~> 0.2"},
{:phoenix_live_dashboard, "~> 0.8.3"},
{:esbuild, "~> 0.10", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.3", runtime: Mix.env() == :dev},

View file

@ -39,7 +39,7 @@
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
"lazy_html": {:hex, :lazy_html, "0.1.11", "136c8e9cd616b4f4e9c1562daa683880891120b759606dc4c3b6b18058ba5d79", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.9.0", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:fine, "~> 0.1.0", [hex: :fine, repo: "hexpm", optional: false]}], "hexpm", "3b1be592929c31eca1a21673d25696e5c14cddfe922d9d1a3e3b48be4163883b"},
"libcluster": {:hex, :libcluster, "3.5.0", "5ee4cfde4bdf32b2fef271e33ce3241e89509f4344f6c6a8d4069937484866ba", [:mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.3", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ebf6561fcedd765a4cd43b4b8c04b1c87f4177b5fb3cbdfe40a780499d72f743"},
"live_stash": {:hex, :live_stash, "0.1.2", "d67d3670cae453fbc063ddba4602c4e342a16c547d54427b31e57abbbfd28bd2", [:mix], [{:phoenix_live_view, "~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:uniq, "~> 0.6", [hex: :uniq, repo: "hexpm", optional: false]}], "hexpm", "46367a2abdf25c8aa8a854f8f480e3eb3b0a1987040b46893d75cdd90e1a9b24"},
"live_stash": {:hex, :live_stash, "0.2.0", "3b4d16b5c9c5262a8b908969e8a570f36c4961a65995f8f6fbd4c68f0f7c734f", [:mix], [{:phoenix_live_view, "~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:uniq, "~> 0.6", [hex: :uniq, repo: "hexpm", optional: false]}], "hexpm", "5f71be36eb28cbbb8f951cdb7b3633092c6d5db2bec6014d68e3476ffb1f9079"},
"live_table": {:hex, :live_table, "0.4.1", "26055f78af6295b6d6deefb5ffd31f87b49c8f74cdf65b6dff0da595767ea470", [:mix], [{:ecto, "~> 3.13", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.13", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:igniter, "~> 0.7.0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.3", [hex: :nimble_csv, repo: "hexpm", optional: false]}, {:oban, "~> 2.20", [hex: :oban, repo: "hexpm", optional: false]}, {:oban_web, "~> 2.11", [hex: :oban_web, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 4.3", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 1.1", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}, {:postgrex, ">= 0.0.0", [hex: :postgrex, repo: "hexpm", optional: false]}, {:sutra_ui, "~> 0.3.0", [hex: :sutra_ui, repo: "hexpm", optional: true]}], "hexpm", "2f20a173e6944526607eb5c91196ce0774fc7235bf715bb2ba2d43828965fd9d"},
"logger_json": {:hex, :logger_json, "7.0.4", "e315f2b9a755504658a745f3eab90d88d2cd7ac2ecfd08c8da94d8893965ab5c", [:mix], [{:decimal, ">= 0.0.0", [hex: :decimal, repo: "hexpm", optional: true]}, {:ecto, "~> 3.11", [hex: :ecto, repo: "hexpm", optional: true]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "d1369f8094e372db45d50672c3b91e8888bcd695fdc444a37a0734e96717c45c"},
"mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"},