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

refactor: Common download operation #1370

Merged

Conversation

adrien-coye
Copy link
Contributor

@adrien-coye adrien-coye commented Jan 2, 2025

We can push the refactor further and share the boilerplate of all DownloadOperations.

I did not rewrite old code that might need further rewrite. This is just code factorisation.

Intended to be reviewed per commit.

Root PR: #1311

Copy link

sonarqubecloud bot commented Jan 6, 2025

Copy link
Member

@PhilippeWeidmann PhilippeWeidmann left a comment

Choose a reason for hiding this comment

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

LGTM.

One question, I'm a bit on the fence regarding the @unchecked Sendable for:

  • DownloadOperation
  • DownloadArchiveOperation

The other operations are fine because they don't have additional mutable state. However in the case of DownloadArchiveOperation we rely on the task that urlSession should be thread safe and calls in a queue downloadCompletion and assigns archiveUrl but nothing protects archiveUrl from being assigned elsewhere.

I won't request changes but this is something we have to keep in mind when using @unchecked

@adrien-coye adrien-coye merged commit cc16b7a into externalLinks-multiSelect Jan 6, 2025
3 checks passed
@adrien-coye adrien-coye deleted the externalLinks-common-download-operation branch January 6, 2025 14:08
@adrien-coye
Copy link
Contributor Author

Discussed regarding the @unchecked Sendable used with legacy Obj-c code.
Do not use it with legacy code without an audit, else do not use it and keep a warning, which make sense.

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.

2 participants