mattermost/server/channels/utils
135yshr 314ed3756a
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Blocked by required conditions
Web App CI / check-external-links (push) Blocked by required conditions
Web App CI / check-types (push) Blocked by required conditions
Web App CI / test (platform) (push) Blocked by required conditions
Web App CI / test (mattermost-redux) (push) Blocked by required conditions
Web App CI / test (channels shard 1/4) (push) Blocked by required conditions
Web App CI / test (channels shard 2/4) (push) Blocked by required conditions
Web App CI / test (channels shard 3/4) (push) Blocked by required conditions
Web App CI / test (channels shard 4/4) (push) Blocked by required conditions
Web App CI / upload-coverage (push) Blocked by required conditions
Web App CI / build (push) Blocked by required conditions
Fix import failures for Japanese filenames with dakuten on macOS (#35204)
* 🐛 fix: normalize Unicode filenames in import attachment lookup

Fix import failures for files with Japanese dakuten/handakuten characters
(e.g., ガ, パ, べ) on macOS.

macOS stores filenames in NFD (decomposed) form while Linux/Windows use
NFC (composed) form. This mismatch caused attachment lookup failures
when zip filenames and JSONL paths used different normalization forms.

Changes:
- Add NormalizeFilename utility function using golang.org/x/text/unicode/norm
- Normalize filenames when building attachment maps from zip files
- Normalize paths when looking up attachments in maps
- Apply fixes to both server (import.go) and mmctl (validate.go)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* avoid duplicating normalizeFilename

* add coverage for Korean filenames

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Jesse Hallam <jesse@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2026-03-18 12:16:55 +00:00
..
fileutils [MM-65822] Add directory conflict checks for plugin and import uploads (#34681) 2026-03-03 16:31:05 -04:00
imgutils [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
mocks Upgrade Go to 1.24.3 (#31220) 2025-06-10 15:04:57 -03:00
testutils [MM-65837], [MM-65824] - Update Dependencies (#33972) 2025-10-01 20:19:22 +00:00
.mockery.yaml Migrate mockery to packages feature (#29013) 2024-11-07 12:48:11 +01:00
api.go encode special characters on some error pages (#35492) 2026-03-10 12:54:42 +01:00
api_test.go encode special characters on some error pages (#35492) 2026-03-10 12:54:42 +01:00
archive.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
archive_test.go MM-53032: Fix module path after repo rename (#23689) 2023-06-11 10:54:35 +05:30
backoff.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
backoff_test.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
emoji.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
file.go fixed initialism errors in accordance with golang conventions in 7 files. (#24287) 2023-08-22 10:15:51 +03:00
file_test.go fixed initialism errors in accordance with golang conventions in 7 files. (#24287) 2023-08-22 10:15:51 +03:00
hash.go Applies perfsprint linter (#24999) 2023-11-03 11:18:18 +01:00
humanize.go MM-57378: Bump up golangci version (#26535) 2024-03-22 10:23:21 +05:30
i18n.go Eliminate MM_SERVER_PATH (#24968) 2024-05-10 18:13:05 -03:00
license-public-key-test.txt update test public key (#22835) 2023-04-28 09:20:12 -05:00
license-public-key.txt Undo accidental merge (#22848) 2023-04-05 11:24:32 -04:00
license.go Fix nil pointer dereference in license validation (#34116) 2025-10-15 11:03:20 -03:00
license_public_key.go Service environment (#23443) 2023-06-07 10:15:33 -03:00
license_test.go Fix nil pointer dereference in license validation (#34116) 2025-10-15 11:03:20 -03:00
markdown.go MM-67091 Fixing notification titles rendering encoded values as-is (#35001) 2026-02-19 13:44:36 +02:00
markdown_test.go MM-67091 Fixing notification titles rendering encoded values as-is (#35001) 2026-02-19 13:44:36 +02:00
merge.go Add whitespace linter (#24855) 2023-10-11 10:13:36 +02:00
merge_test.go [MM-61302] Use model.NewPointer throughout the code base (#28957) 2024-10-29 13:29:53 +01:00
policies-roles-mapping.json Integration permission management changes (#34421) 2025-11-13 11:12:30 +00:00
random.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
subpath.go MM-64486: Remove telemetry (#33606) 2025-09-04 18:46:18 +00:00
subpath_test.go MM-64486: Remove telemetry (#33606) 2025-09-04 18:46:18 +00:00
textgeneration.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
time.go Set batched notification email timestamps to user TZ (#26121) 2024-02-29 12:42:34 +01:00
time_test.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
unicode.go Fix import failures for Japanese filenames with dakuten on macOS (#35204) 2026-03-18 12:16:55 +00:00
unicode_test.go Fix import failures for Japanese filenames with dakuten on macOS (#35204) 2026-03-18 12:16:55 +00:00
urlencode.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
urlencode_test.go Add whitespace linter (#24855) 2023-10-11 10:13:36 +02:00
utils.go [MM-65588] Fix OAuth login with redirect_to URL (#34944) 2026-02-10 15:06:28 -05:00
utils_test.go [MM-65588] Fix OAuth login with redirect_to URL (#34944) 2026-02-10 15:06:28 -05:00