An out-of-order refresh bring old data(?)
See original GitHub issueI have an issue with users with slow connections. They are updating invoices in their phones (android) and sometimes the values are lost or overwritten.
<input type="text" id="discount" name="discount" inputmode="decimal" hx-post="" hx-trigger="keyup changed delay:2s" hx-swap="outerHTML" hx-target="#content" hx-select="#content">
So, this is the flow of actions:
- Enter a value like 23. It gets sent to the server
- Now remove it or change it (23.3). It gets sent to the server
- Sometimes it gets rewritten into 23
- Then the server has responded with 23 then 23.3
I attach a video of the issue: https://user-images.githubusercontent.com/238983/133696804-155505bd-600e-441d-9263-443b68b1d44c.mp4
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
angular - Data saved in service lost on page refresh or change
toPromise() on the Http client and into the observables. It'll make working with other things (also observables) easier accross the app, and the ......
Read more >Pivot Table Sorting Fixes & Tips - Contextures
New Excel Pivot Table Items Out of Order. When you add new records to your pivot table source data, and refresh the pivot...
Read more >Forms response columns are out of order - Microsoft Learn
To work around this issue, locate the Responses tab on the form, click the ellipses, and then select Sync all responses to a...
Read more >Streams Concepts | Confluent Documentation
Because the second data record would not be considered an update of the previous record. Compare this behavior of KStream to KTable below, ......
Read more >Brute-Force Refreshing View-Data In The Background In ...
ASIDE: You might be wondering why I don't use something like the RxJS switchMap() operator so that I can cancel older requests when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, after looking at the code and remembering I have reported this issue, I do this change:
This keeps the value to be replaced and avoids “jump” out of focus. Maybe add an option to hx-preserve for values?
Also
keyup changed delay:1s
means the delay is applied to both events? Or could be the delay is only for the last?P.D: Removing the delay make the problem more evident.