Skip to content

Bugfix FXIOS-11809 [Blueprint Download Manager] Avoid automatic throttling of live activity updates #26134

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 4 commits into
base: main
Choose a base branch
from

Conversation

DanielDervishi
Copy link
Collaborator

📜 Tickets

Jira ticket
Github issue

💡 Description

  • Try downloading a large enough file beforehand, you'll notice that in the beginning updates in the live activity happen rather quickly, but are later throttled
  • Now, we implement our own throttling to ensure a reasonable amount of updates happen per second

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

@DanielDervishi DanielDervishi requested a review from ih-codes April 15, 2025 20:25
@DanielDervishi DanielDervishi requested a review from a team as a code owner April 15, 2025 20:25
@mobiletest-ci-bot
Copy link

Messages
📖 Project coverage: 36.49%
📖 Edited 1 files
📖 Created 0 files

Client.app: Coverage: 34.91

File Coverage
DownloadLiveActivityWrapper.swift 6.67% ⚠️

Generated by 🚫 Danger Swift against 737a0c9

Comment on lines 54 to 74
Task {
await downloadLiveActivity?.end(using: contentState,
dismissalPolicy: .after(.now.addingTimeInterval(durationToDismissal.rawValue)))
if !throttle || shouldUpdateLiveActivity() {
Task {
await self.downloadLiveActivity?.update(using: contentState)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DanielDervishi! In an attempt to try to make our concurrency as structured as possible could we make this update async and then have the callers create the tasks? Then we wouldn't need to spin up two separate tasks for updating and for ending the activity?

We really only want to create a new task (unstructured concurrency) when we don't care when the work finishes (fire and forget) Update feels like something we want to wait to finish right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, thanks Carson!

@DanielDervishi DanielDervishi force-pushed the DD/11809-less-updates-download-live-activities branch from 737a0c9 to 42d7ada Compare April 22, 2025 16:46
@DanielDervishi DanielDervishi requested a review from Cramsden April 22, 2025 16:46
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.

3 participants