Skip to content

Fix trailing-dot activity format detection - #1498

Merged
ryanbr merged 1 commit into
ryanbr:mainfrom
bhelm:fix/issue-97-activity-detect-trailing-dot
Aug 21, 2026
Merged

Fix trailing-dot activity format detection#1498
ryanbr merged 1 commit into
ryanbr:mainfrom
bhelm:fix/issue-97-activity-detect-trailing-dot

Conversation

@bhelm

@bhelm bhelm commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • make Swift treat only the substring after the literal final dot as a filename extension, matching Kotlin
  • fall back to content sniffing when a filename has no usable suffix, including trailing and repeated dots
  • add mirrored public tests for all issue cases plus case-insensitive, no-dot, FIT/GPX/TCX content controls

Root cause

Swift used split(separator: "."), which omits empty subsequences, so ride.fit. incorrectly reused fit as the extension. Kotlin uses the literal substring after the final dot, which is empty and correctly falls back to content detection. The Swift detector now follows that same last-suffix contract; Kotlin production is unchanged.

Validation

  • RED before fix: mirrored acceptance tests were present while the unchanged Swift detector still omitted empty suffixes
  • the first review's missing-control finding was reproduced with exactly 3 omissions per platform, then fixed without another product change
  • frozen three-file diff is an exact semantic subset of the independently reviewed product-fix union
  • Swift exact focused trailing-dot test: passed
  • Swift affected StrandImport suite: 28 tests passed
  • Swift full StrandImport suite: 241 tests passed, 0 failures, 1 environment-dependent skip
  • Kotlin focused/affected mirrored test: passed
  • Kotlin FullDebug: 4,157 tests passed, 0 failures/errors, 6 skipped
  • exact static acceptance guards and git diff --check: pass
  • independent final review: pass, no P0/P1/P2

Fixes bhelm#97.

@ryanbr
ryanbr merged commit e483762 into ryanbr:main Aug 21, 2026
14 checks passed
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.

[P2] Activity format detection diverges for trailing-dot filenames

2 participants