Fix lockfile show page not updating via Turbo#222
Closed
JuanVqz wants to merge 1 commit into
Closed
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_check!to Sidekiq, the lockfile show page rendered before anyLockfileCheckorGemCheckrows existed in the DBResolveGemthen broadcast updates todom_id(gem_check)targets that were never in the DOM, so results only appeared after a manual refreshStartCheckright aftercreate_for!, so all<tr id="gem_check_XYZ">rows are rendered before individual resolve-gem broadcasts fireChanges
_checks_container.html.erband_lockfile_check_section.html.erbpartials from inlineshow_new.html.erb<div id="lockfile_X_checks">as a stable Turbo broadcast targetStartCheck#performreloads the association and broadcastsbroadcast_replace_toaftercreate_for!+enqueue_gem_checksTest plan
ResolveGemjobs complete (no refresh needed)