From a527c0678e044b6c2ebb4165751da7247d131fe7 Mon Sep 17 00:00:00 2001 From: Chuck Smith Date: Tue, 19 May 2026 10:02:19 -0400 Subject: [PATCH 1/2] chore: remove redundant @failed_execution and @blocked_execution assigns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Associations are already eager-loaded via includes in the show action. The view now reads @job.failed_execution and @job.blocked_execution directly — no extra queries, no extra variables. Co-Authored-By: Claude Sonnet 4.6 --- .../solid_queue_web/jobs_controller.rb | 2 -- app/views/solid_queue_web/jobs/show.html.erb | 18 +++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/controllers/solid_queue_web/jobs_controller.rb b/app/controllers/solid_queue_web/jobs_controller.rb index 800a9ce..c4fde60 100644 --- a/app/controllers/solid_queue_web/jobs_controller.rb +++ b/app/controllers/solid_queue_web/jobs_controller.rb @@ -14,8 +14,6 @@ def show @job = SolidQueue::Job .includes(:ready_execution, :scheduled_execution, :claimed_execution, :blocked_execution, :failed_execution) .find(params[:id]) - @failed_execution = @job.failed_execution - @blocked_execution = @job.blocked_execution @execution_status = derive_status(@job) end diff --git a/app/views/solid_queue_web/jobs/show.html.erb b/app/views/solid_queue_web/jobs/show.html.erb index 3dccc52..6a8acfa 100644 --- a/app/views/solid_queue_web/jobs/show.html.erb +++ b/app/views/solid_queue_web/jobs/show.html.erb @@ -7,10 +7,10 @@
- <% if @execution_status == "failed" && @failed_execution %> - <%= button_to "Retry", retry_failed_job_path(@failed_execution), method: :post, + <% if @execution_status == "failed" && @job.failed_execution %> + <%= button_to "Retry", retry_failed_job_path(@job.failed_execution), method: :post, class: "sqd-btn sqd-btn--primary" %> - <%= button_to "Discard", failed_job_path(@failed_execution), method: :delete, + <%= button_to "Discard", failed_job_path(@job.failed_execution), method: :delete, class: "sqd-btn sqd-btn--danger", data: { confirm: "Discard this job?" } %> <% elsif SolidQueueWeb::Job::DISCARDABLE.include?(@execution_status) %> @@ -45,9 +45,9 @@
Concurrency Key
<%= @job.concurrency_key.presence || "—" %>
- <% if @blocked_execution %> + <% if @job.blocked_execution %>
Blocked Until
-
<%= @blocked_execution.expires_at ? @blocked_execution.expires_at.strftime("%Y-%m-%d %H:%M:%S %Z") : "—" %>
+
<%= @job.blocked_execution.expires_at ? @job.blocked_execution.expires_at.strftime("%Y-%m-%d %H:%M:%S %Z") : "—" %>
<% end %>
Enqueued At
@@ -67,14 +67,14 @@
-<% if @failed_execution %> +<% if @job.failed_execution %>

Error

- <%= @failed_execution.exception_class %>: <%= @failed_execution.message %> + <%= @job.failed_execution.exception_class %>: <%= @job.failed_execution.message %>

- <% if @failed_execution.backtrace.present? %> -
<%= Array(@failed_execution.backtrace).join("\n") %>
+ <% if @job.failed_execution.backtrace.present? %> +
<%= Array(@job.failed_execution.backtrace).join("\n") %>
<% end %>
<% end %> From 8b7202f4285f4fa9d3ae295b94e8e8fb7aa9b258 Mon Sep 17 00:00:00 2001 From: Chuck Smith Date: Tue, 19 May 2026 10:04:43 -0400 Subject: [PATCH 2/2] chore: remove stale queue: @queue from status tab links @queue is no longer set in JobsController#index after the Queues::JobsController refactor. The nil was harmless but dead code. Co-Authored-By: Claude Sonnet 4.6 --- app/views/solid_queue_web/jobs/index.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/solid_queue_web/jobs/index.html.erb b/app/views/solid_queue_web/jobs/index.html.erb index 323f49e..44c64c0 100644 --- a/app/views/solid_queue_web/jobs/index.html.erb +++ b/app/views/solid_queue_web/jobs/index.html.erb @@ -5,11 +5,11 @@
- <%= link_to "Ready", jobs_path(status: "ready", queue: @queue, q: @search), class: @status == "ready" ? "active" : "" %> - <%= link_to "Scheduled", jobs_path(status: "scheduled", queue: @queue, q: @search), class: @status == "scheduled" ? "active" : "" %> - <%= link_to "Running", jobs_path(status: "claimed", queue: @queue, q: @search), class: @status == "claimed" ? "active" : "" %> - <%= link_to "Blocked", jobs_path(status: "blocked", queue: @queue, q: @search), class: @status == "blocked" ? "active" : "" %> - <%= link_to "Failed", jobs_path(status: "failed", queue: @queue, q: @search), class: @status == "failed" ? "active" : "" %> + <%= link_to "Ready", jobs_path(status: "ready", q: @search), class: @status == "ready" ? "active" : "" %> + <%= link_to "Scheduled", jobs_path(status: "scheduled", q: @search), class: @status == "scheduled" ? "active" : "" %> + <%= link_to "Running", jobs_path(status: "claimed", q: @search), class: @status == "claimed" ? "active" : "" %> + <%= link_to "Blocked", jobs_path(status: "blocked", q: @search), class: @status == "blocked" ? "active" : "" %> + <%= link_to "Failed", jobs_path(status: "failed", q: @search), class: @status == "failed" ? "active" : "" %>
<% if discardable && @jobs.any? %>