fix: prevent downloaded media filename collisions - #2353
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c86387a931
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| media: UiMedia, | ||
| ): String { | ||
| val key = sanitizeFileName(statusKey) | ||
| val handle = sanitizeFileName(userHandle) | ||
| val extension = extensionFromUrl(url = media.url, fallbackExtension = media.fallbackExtension) | ||
| return "${key}_$handle.$extension" | ||
| } | ||
| mediaIndex: Int, |
There was a problem hiding this comment.
Update Swift callers for the required media index
When the iOS workflow in .github/workflows/ios.yml regenerates KotlinSharedUI and runs xcodebuild, this required parameter changes the exported Swift signature, but appleApp/ios/UI/Screen/MediaViewerScreen.swift:439-443 and appleApp/ios/UI/Component/IOSTimelineMediaActions.swift:130-134 still invoke it with only three arguments. The iOS target therefore fails to compile with a missing mediaIndex argument; update both Swift helpers to calculate and pass the media's position.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4c0f870b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) -> String { | ||
| MediaFileNamePolicy.shared.statusMediaFileName( | ||
| let medias = Array(post.images) | ||
| let mediaIndex = medias.firstIndex { $0.url == media.url } ?? 0 |
There was a problem hiding this comment.
Derive filenames from the media's actual position
When a status contains multiple audio entries with the same URL, firstIndex returns the first position for every entry, so iOS save-all gives them all the same _01 filename and can overwrite or conflate separate exports (the entries may still differ by headers or metadata). The same URL-only lookup appears in MediaViewerScreen.swift; pass the enumerated/selected position instead of recovering it from a non-unique URL.
Useful? React with 👍 / 👎.
No description provided.