das-developers / das2java

The original das2 library. Provides interactive publication-ready 2-D plotting
https://das2.org
GNU Lesser General Public License v3.0
4 stars 0 forks source link

GitHub/GitLabs file system fails to see update on Windows #76

Closed jbfaden closed 10 months ago

jbfaden commented 11 months ago

Bill's Autoplot failed to get the update made on abbith, a GitLab server. This has only been seen on Windows. My virtual machine Windows worked fine, but I was able to get the bug to show on a campus laptop.

jbfaden commented 11 months ago

I believe I see that the problem is on any platform, and is caused when there is an update which does not change the length of the resource. This is good because it explains the problem, where it was relying on a missing timestamp from the remote resource, but when missing the timestamp, the local file timestamp is used. The code should just use ETAG, which was coded later.

  1. plot https://research-git.uiowa.edu/jbf/publicprojecttest/-/blob/main/data/datafile.csv
  2. make a change in datafile.csv which changes the data but does not change the length (156.4->056.4).
  3. see that this update is not seen by clients.

Note that typically git is used to distribute code, and code modifications typically change the length, which explains why this was never noticed.

jbfaden commented 10 months ago

If the ETag changes, then download the resource. The old (slightly incorrect) logic, where if it is the same then do not download, is still in there. To correct the logic we would go through with the conditional (If-None-Match) request, including the local ETAG, which would allow the server to respond with 304 (not modified). https://amirsoleimani.medium.com/understanding-etags-how-they-improve-website-performance-7eab63d2d5#:~:text=Whenever%20a%20client%20requests%20a%20resource%2C%20the%20browser%20checks%20if,cached%20version%20of%20the%20resource.