Skip to content

fix(filesystem): progress notification for the last chunk #2359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

akdasa
Copy link

@akdasa akdasa commented May 4, 2025

The progress notification might not be triggered when a file finishes downloading if it completes too quickly due to the time-based threshold logic. As a result, the client may never receive a progress update showing 100% completion (it often stops at something like 98.1234%).

This PR ensures that the progress notification is sent when the file has fully downloaded, guaranteeing the client receives an update with 100% progress.

Improvements to progress update logic:

  • filesystem/ios/Sources/FilesystemPlugin/Filesystem.swift: Added isTimeToEmit and isLastChunk variables to clarify the conditions for emitting progress updates. This ensures that progress is emitted either when the time threshold (0.1 seconds) is reached or when the operation is complete (totalBytesWritten == totalBytesExpectedToWrite).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant