Skip to content
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

Add sync hash table to control episode download cache #2748

Merged
merged 9 commits into from
Feb 14, 2025

Conversation

SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Feb 13, 2025

| 📘 Part of: # |
|:---:|

Fixes #

Adds a synced hash table that is controlled by a synchronous queue and then use this to controls access the episode downloads queue.

To test

  1. Start the App
  2. Choose a Podcast with multiple episodes
  3. Select multiple episodes and start downloading them
  4. Select another podcast and also start the downloads for it
  5. Play an episode at the same time.
  6. Check if no crash happens.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@SergioEstevao SergioEstevao added the [Type] Bug Used for issues where something is not functioning as intended. label Feb 13, 2025
@SergioEstevao SergioEstevao added this to the 7.82 ❄️ milestone Feb 13, 2025
Copy link
Contributor

@danielebogo danielebogo left a comment

Choose a reason for hiding this comment

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

Just left few comments. Can you add few tests to make sure it works?

@danielebogo
Copy link
Contributor

@SergioEstevao can you also update the Changelog?

@SergioEstevao SergioEstevao marked this pull request as ready for review February 14, 2025 15:04
@SergioEstevao SergioEstevao requested a review from a team as a code owner February 14, 2025 15:04
@danielebogo danielebogo changed the base branch from release/7.82 to trunk February 14, 2025 15:05
@danielebogo danielebogo modified the milestones: 7.82 ❄️, 7.83 Feb 14, 2025
Copy link
Contributor

@danielebogo danielebogo left a comment

Choose a reason for hiding this comment

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

works really good! :shipit:


@testable import podcasts

final class ThreadSafeDictionaryTests: XCTestCase {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this!

# Conflicts:
#	Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift
@SergioEstevao SergioEstevao merged commit 97f8e79 into trunk Feb 14, 2025
4 of 6 checks passed
@SergioEstevao SergioEstevao deleted the fix_downloads_cache_access branch February 14, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Used for issues where something is not functioning as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants