Persist jobs and artifacts filters in the URL#270
Merged
Conversation
Both pages kept their filter selection and pager offsets only in socket assigns, so any LiveView re-mount — a websocket reconnect, a deploy, or a plain refresh — dropped them through mount/3. Sync that state to the URL with push_patch and restore it in handle_params, the same way the docker tags page already does, so filters survive reconnects and the views are shareable.
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.
The jobs and artifacts pages kept their filter selection and pager offsets only in socket assigns, so any LiveView re-mount — a websocket reconnect, a deploy, or a plain refresh — dropped them through
mount/3. That's why a selected filter would silently clear after ~30s on production.Sync that state to the URL with
push_patchand restore it inhandle_params, the same pattern the Docker tags page already uses (6dd0bee). Filters now survive reconnects and the views are shareable/bookmarkable.Covers every LiveView where a re-mount loses state: Jobs (
/) and Artifacts (/artifacts); Docker tags (/docker) already did this.Pairs with hexpm-ops
bob-websocket-timeout, which stops the 30s websocket drops that triggered the re-mounts in the first place.