Fix issue workspace refresh compilation

1194347a978a · AtlantisPleb · · parent f05131a67dc1

Fix issue workspace refresh compilation

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

built
6 modules in 31.8 s
deployed
live · 6 modules on 3 nodes · push→live —
deployed
needs_rolling_replace · 6 modules on 0 nodes · push→live —

Changed files

  • modified lib/openagents_web/live/issue_workspace_live.ex
  • modified test/openagents_web/live/issue_workspace_live_test.exs

Diff

2 files changed, +11 -8

lib/openagents_web/live/issue_workspace_live.ex modified +8 -5

@@ -90,13 +90,16 @@ defmodule OpenAgentsWeb.IssueWorkspaceLive do

90 90
                         do: 0,
91 91
                         else: 250
92 92
93
  # Zero debounce means tests: refresh synchronously on the change message so
94
  # assertions need no waiting.
95
  defp schedule_refresh(socket) when @refresh_debounce_ms == 0 do
96
    load(socket)
93
  defp schedule_refresh(socket) do
94
    if @refresh_debounce_ms == 0 do
95
      # Tests refresh synchronously so assertions do not depend on time.
96
      load(socket)
97
    else
98
      rearm_refresh(socket)
99
    end
97 100
  end
98 101
99
  defp schedule_refresh(socket) do
102
  defp rearm_refresh(socket) do
100 103
    case socket.assigns.refresh_timer_ref do
101 104
      nil ->
102 105
        assign(
test/openagents_web/live/issue_workspace_live_test.exs modified +3 -3

@@ -224,7 +224,7 @@ defmodule OpenAgentsWeb.IssueWorkspaceLiveTest do

224 224
             )
225 225
    end
226 226
227
    test "a burst of writes coalesces into one refresh", context do
227
    test "a burst of writes converges to every new issue", context do
228 228
      {:ok, view, _html} = live(context.conn, ~p"/issues")
229 229
230 230
      Enum.each(1..5, fn n ->

@@ -232,8 +232,8 @@ defmodule OpenAgentsWeb.IssueWorkspaceLiveTest do

232 232
        send(view.pid, {:issues_changed, context.private.id})
233 233
      end)
234 234
235
      # With the test debounce at zero every armed timer fires immediately; what
236
      # matters here is that the page converges to all five rows in one piece.
235
      # Tests use a zero debounce so the page converges without waiting on a
236
      # wall-clock timer. Production uses the re-armed debounce path.
237 237
      _ = :sys.get_state(view.pid)
238 238
239 239
      html = render(view)

This page updates live while a promote is in flight · changelog