Skip to content

fix: prevent downloaded media filename collisions - #2353

Open
Tlaster wants to merge 2 commits into
masterfrom
codex/fix-media-download-filename-index
Open

fix: prevent downloaded media filename collisions#2353
Tlaster wants to merge 2 commits into
masterfrom
codex/fix-media-download-filename-index

Conversation

@Tlaster

@Tlaster Tlaster commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines 10 to +11
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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant