Skip to content

Keep the feed ticker away from a browser running the previous release - #1668

Merged
wintermeyer merged 1 commit into
mainfrom
fix-tab-ticker-stale-assets
Aug 24, 2026
Merged

Keep the feed ticker away from a browser running the previous release#1668
wintermeyer merged 1 commit into
mainfrom
fix-tab-ticker-stale-assets

Conversation

@wintermeyer

Copy link
Copy Markdown
Owner

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.js are 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 own FeedTicker hook, so it drew bare and no clock ever ran. Reloading fixes it, which is why it now looks correct.

Change root.html.heex marks both assets phx-track-static, so the client reports them on join. VutuvWeb.PostLive.Feed.mount_feed/2 reads static_changed?/1 once (connect params exist only during mount) and ticker_due?/1 refuses 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

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
@wintermeyer
wintermeyer merged commit b7a142e into main Aug 24, 2026
1 check passed
@wintermeyer
wintermeyer deleted the fix-tab-ticker-stale-assets branch August 24, 2026 20:16
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