mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 23:16:54 +03:00
[PR #695] [MERGED] Fix: safari bug downloadspeed #6224
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/sigoden/dufs/pull/695
Author: @florinm03
Created: 4/26/2026
Status: ✅ Merged
Merged: 4/27/2026
Merged by: @sigoden
Base:
main← Head:fix/safari-bug-downloadspeed📝 Commits (2)
80ae2a0NaN or undefined guard for safari and throttled DOM updates1b2a3aduse variable📊 Changes
1 file changed (+3 additions, -1 deletions)
View changed files
📝
assets/index.js(+3 -1)📄 Description
On Safari, the download speed was updating too fast. Moreover, the speed was not readable, and you could see
NaN and undefined.Some pictures before the fix
Same upload on Brave:

From what I gathered:
progressevents very rapidlyDate.now()returns the same value for both, because of 1ms resolutionelapsed = 0-> division by zero -> Infinity -> NaN cascadeBrave/Chrome have sub-millisecond timer resolution, so two events within the same millisecond still return different
Date.now()values, andelapsedis never0.Here is a video of how it looked after the guard.
https://github.com/user-attachments/assets/182f782f-c52c-4f10-8803-b5620edd9a76
So a "throttle" was necessary, hence the
elapsed < 300https://github.com/user-attachments/assets/487a01c0-0f42-4de0-a51a-a8e84c8f60d1
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.