Improve accuracy of progress updates#144
Merged
adityaramani merged 12 commits intoapple:mainfrom Jun 13, 2025
Merged
Conversation
…nge between read and write
crosbymichael
pushed a commit
to apple/containerization
that referenced
this pull request
Jun 11, 2025
This PR ensures that we enter a lock inside the `@SendableProperty` implementation as soon as we access a computed property. Additionally, it mirrors the access level of the original property. Both changes are required for [improved accuracy](apple/container#144) of progress updates in container. Additionally, it should resolve #60 that occurs on certain configurations. Please tag as 0.1.1 after merging.
# Conflicts: # Package.swift
Contributor
adityaramani
left a comment
There was a problem hiding this comment.
Thanks! Had a couple small questions. Will also wait for more views on this
| /// A progress bar that updates itself as tasks are completed. | ||
| public final class ProgressBar: Sendable { | ||
| let config: ProgressConfig | ||
| // `@SendableProperty` adds `_state: Synchronized<State>`, which can be updated inside a lock using `_state.withLock()`. |
Contributor
There was a problem hiding this comment.
Would this property should up in IDEs? Would the user be able to navigate into the def for the property?
Contributor
Author
dcantah
approved these changes
Jun 13, 2025
dcantah
approved these changes
Jun 13, 2025
adityaramani
approved these changes
Jun 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR resolves the problem of dropped progress updates and ensures the accuracy of the information provided in the progress bar. Additionally, it adds the displaying of the finished state to the progress bar. Requires merging and tagging apple/containerization#91.