mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5126] [MERGED] fix(desktop): in-memory update progress polling #5067
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5067
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/hoppscotch/hoppscotch/pull/5126
Author: @CuriousCorrelation
Created: 6/4/2025
Status: ✅ Merged
Merged: 6/13/2025
Merged by: @jamesgeorge007
Base:
patch← Head:fix-desktop-update-progress-polling📝 Commits (3)
1430e38fix(desktop): in-memory update progress polling4839ec4fix: unused progress tracking in store calls3208b39fix: remove progress persistence artifacts📊 Changes
3 files changed (+66 additions, -36 deletions)
View changed files
📝
packages/hoppscotch-desktop/src/types/index.ts(+0 -4)📝
packages/hoppscotch-desktop/src/utils/updater.ts(+28 -27)📝
packages/hoppscotch-desktop/src/views/Home.vue(+38 -5)📄 Description
This fixes a Windows-specific issue where the updater would hang during download and installation.
The cause was file I/O operations called from within progress callbacks conflicting with Windows' "stricter" fs behavior during concurrent ops.
This move that to an in-memory tracking with periodic polling, removing all disk writes from the download callback to only for actual final commits.
Closes HFE-892
Closes #5038
Notes to reviewers
This is a Windows-specific thing, doesn't affect Mac/Linux functionality.
The core change is moving from synchronous progress persistence to asynchronous polling-based updates.
Progress tracking remains fully functional with 100ms polling intervals for just a bit smooth UI updates.
The existing implementation called
saveUpdateState()directly within the updater's progress callback.This approach worked fine on Mac/Linux but not on Windows apparently due to Windows' mandatory file locking behavior.
According to the docs Windows uses mandatory locking where if one program locks the file, all other programs get error messages when they try to access it, unlike Unix which generally doesn't use locking at all, and when it does, lock is usually advisory.
The Windows file locking behavior stems from its inheritance of "sharing mode" from LAN Manager in the MS-DOS
era, which implements "mandatory locking as a special case" while "Linux doesn't have an equivalent to 'share modes' (all access is allowed by default)".
The updater's internal I/O ops conflicted with progress disk writes because Windows uses whole file locking for most cases, part of the API for opening files
CreateFile.So the fix implements a polling-based arch where progress is stored in memory during download and periodically read by the UI through a polling function.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.