Keep the feed ticker away from a browser running the previous release - #1668
Merged
Conversation
Ein Deploy lädt eine offene Seite nicht neu: der Socket verbindet sich mit der neuen Version und patcht deren Markup in ein Dokument, dessen CSS und JavaScript Stunden alt sind. Alles andere im Feed übersteht das, weil sein Aussehen schon in der alten Datei stand; der Anriss aus v7.347.0 nicht, denn er bringt eigene Regeln und einen eigenen Hook mit. Auf jedem Feed, der seit vor dem Deploy offen stand, stand er deshalb als unformatierter Absatz quer über der Reiterleiste, den keine Uhr je wegnahm. Die Leiste kann das jetzt wissen: `root.html.heex` markiert beide Dateien mit `phx-track-static`, der Browser meldet sie beim Verbinden, und `mount_feed/2` liest `static_changed?/1` einmal (Connect-Parameter gibt es nur beim Mount). Wer eine alte Version fährt, behält den Punkt und bekommt kein Zitat, bis er die Seite neu lädt. Diesen Text hat ein KI-Agent in meinem Namen geschrieben. Ich weiß, dass das problematisch ist. Claude-Session: https://claude.ai/code/session_015FkPnYb5ofJPHphLLxGhvc
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.
Symptom On
/feed, the new tab ticker (v7.347.0) rendered as an unstyled blue paragraph across the tab bar and never went away — but only in tabs that had been open since before the deploy.Cause A deploy does not reload an open page. The socket reconnects to the new release and patches its markup into a document whose
app.css/app.jsare the previous release's. Everything else the feed streams looks right there, because its CSS already shipped; the ticker is new markup with its own stylesheet and its ownFeedTickerhook, so it drew bare and no clock ever ran. Reloading fixes it, which is why it now looks correct.Change
root.html.heexmarks both assetsphx-track-static, so the client reports them on join.VutuvWeb.PostLive.Feed.mount_feed/2readsstatic_changed?/1once (connect params exist only during mount) andticker_due?/1refuses to open a window for such a browser: it keeps the unseen dot, which renders fine, and skips the quote until the next full page load.Tests: a stale client gets the dot and no quote, a current one gets both, and the layout keeps the annotation the check depends on.
An AI agent wrote this text in my name. I know that is problematic.
https://claude.ai/code/session_015FkPnYb5ofJPHphLLxGhvc