Skip to content

Fix lockfile show page not updating via Turbo#222

Closed
JuanVqz wants to merge 1 commit into
mainfrom
feature/fix-lockfile-turbo-broadcast
Closed

Fix lockfile show page not updating via Turbo#222
JuanVqz wants to merge 1 commit into
mainfrom
feature/fix-lockfile-turbo-broadcast

Conversation

@JuanVqz
Copy link
Copy Markdown
Member

@JuanVqz JuanVqz commented May 13, 2026

Summary

  • After Defer run_check! to Sidekiq to fix web dyno memory pressure #216 deferred run_check! to Sidekiq, the lockfile show page rendered before any LockfileCheck or GemCheck rows existed in the DB
  • The page showed a blue "No checks have been run" alert; ResolveGem then broadcast updates to dom_id(gem_check) targets that were never in the DOM, so results only appeared after a manual refresh
  • Fix: broadcast a full replace of the checks container from StartCheck right after create_for!, so all <tr id="gem_check_XYZ"> rows are rendered before individual resolve-gem broadcasts fire

Changes

  • Extract _checks_container.html.erb and _lockfile_check_section.html.erb partials from inline show_new.html.erb
  • Wrap checks area in <div id="lockfile_X_checks"> as a stable Turbo broadcast target
  • StartCheck#perform reloads the association and broadcasts broadcast_replace_to after create_for! + enqueue_gem_checks
  • Update "no checks" message to "Your lockfile is being processed..." so users know work is underway

Test plan

  • Upload a Gemfile.lock with a Rails 7.x dependency via the UI
  • Confirm the show page immediately renders the checks section with "Checking..." badge (no blue alert)
  • Confirm individual gem rows update in place as ResolveGem jobs complete (no refresh needed)

…starts

When run_check! was deferred to Sidekiq (#216), the show page rendered
before LockfileCheck/GemCheck rows existed, so ResolveGem broadcasts
targeted DOM elements that were never rendered. Extract checks into
partials and broadcast a replace from StartCheck after create_for! so
the <tr id="gem_check_XYZ"> targets exist before resolve jobs fire.
@JuanVqz JuanVqz requested a review from arielj May 14, 2026 03:07
@JuanVqz JuanVqz closed this May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant