fix misleading docs for enableLatencySim #3502
Open
+1
−1
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 docs for
liveSocket.enableLatencySim
seem misleading if not outright wrong:"Round-trip time" means the total time taken for the signal to go from client to server then back again. I.e. if I set the latency sim to
5000
ms, I would expect that when I e.g. when I change something in an<input>
it would take 5 seconds to see the result (e.g. error messages appearing on the form.)But experimenting with this feature, it seems that the argument I submit to
enableLatencySim
is actually the one-way time, not the round-trip time. I.e. if I set it to5000
ms then it takes 10 seconds to see the results of my actions, not 5.I'm not sure what the actual intended behaviour is (I can't figure it out from a brief look at the JS source code) but the docs don't appear to match what actually happens. Submitting this minor doc change to make it consistent.