shlinked icon indicating copy to clipboard operation
shlinked copied to clipboard

Refresh bug

Open cbh123 opened this issue 4 years ago • 1 comments

Problem

Pages on ShlinkedIn will occasionally refresh. This is really annoying if you're on a form page because all your text will be deleted.

Other things to note:

  • I haven't been able to reproduce locally
  • This has been happening basically since ShlinkedIn was started (jan 2021).
  • the problem doesn't seem to be memory or activity. Watching the server logs doesn't show any swap memory being used, and the bug seems to happen regardless of how active ShlinkedIn is at the time (this could be wrong though)
  • I've noticed this message in the logs when the refresh happens:
Your app is failing health checks, which means it isn't listening on port 4000 yet. 
 Readiness probe failed: dial tcp 192.168.203.252:4000: connect: connection refused 
 Attempting to start 'shlinkedin' on host 'b'shlinkedin-8556f447b5-l9g5x'' 
 Attempting health checks on port 4000 
 web.1 | started with pid 44 
 Your app is failing health checks, which means it isn't listening on port 4000 yet. 
 Readiness probe failed: dial tcp 192.168.203.252:4000: connect: connection refused 

This is a normal, expected message when an app is deployed, and the health checks look normal shortly afterwards.

Theories

  1. @smaugs theory. The issue here is that I think this is how liveview is actually designed to work? shDataProblem-1.pdf
  2. Something going wrong with a broadcast when a new post or comment is made? Or an error that is broadcasted out to all pages? https://github.com/cbh123/shlinked/blob/main/lib/shlinkedin/timeline.ex#L305
  3. ???

cbh123 avatar Aug 04 '21 16:08 cbh123

Given how LiveView works, Smaug's observation needs looking at regardless of whether it's causing this bug: https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html

When the whole page refreshes, it probably means that either enough state changed that the system had to re-render the whole page, or things are put together in a way that means the relevant parts of the page can't be separated out.

holmesjr avatar Aug 05 '21 01:08 holmesjr