Skip to content

Conversation

@joshtrichards
Copy link
Member

@joshtrichards joshtrichards commented Dec 8, 2025

Summary

Primary changes:

  • Fixes implementation for custom mappings to preserve numeric keys (which was passing the prior unit test)
  • Fixes test that wasn't testing the custom mappings code path

Secondary changes:

  • Refactors tests to use an isolated temp dir with proper cleanup
  • Adds a focused test to see if numeric-looking keys (e.g. "001") are preserved
    • (the current implementation is brittle and can break if we aren't careful with how we manage keys)

TODO

  • ...

Checklist

@joshtrichards joshtrichards force-pushed the jtr/fix-mime-detection-tests branch from d8e15d1 to 7e493ac Compare December 8, 2025 15:34
- adds a focused DetectionTest that ensures numeric-looking keys (e.g. "001") are preserved
- refactors filesystem tests to use an isolated temp dir with proper cleanup

Signed-off-by: Josh <[email protected]>
Replace array_merge with array_replace for definitions

Signed-off-by: Josh <[email protected]>
@joshtrichards joshtrichards force-pushed the jtr/fix-mime-detection-tests branch from 23db625 to e476a22 Compare December 9, 2025 14:22
@joshtrichards joshtrichards changed the title test(files/type): leading zero extension preservation fix(files/type): custom mappings leading zero extension preservation Dec 9, 2025
@joshtrichards joshtrichards changed the title fix(files/type): custom mappings leading zero extension preservation fix(files/type): preserve numeric keys (follow-up) Dec 10, 2025
@joshtrichards joshtrichards marked this pull request as ready for review December 10, 2025 03:27
@joshtrichards joshtrichards requested a review from a team as a code owner December 10, 2025 03:27
@joshtrichards joshtrichards requested review from Altahrim, ArtificialOwl, CarlSchwan and icewind1991 and removed request for a team December 10, 2025 03:27
@joshtrichards joshtrichards added 3. to review Waiting for reviews feature: files bug tests Related to tests labels Dec 10, 2025
@joshtrichards joshtrichards added this to the Nextcloud 33 milestone Dec 10, 2025
@susnux susnux merged commit 8c90d4f into master Dec 23, 2025
192 checks passed
@susnux susnux deleted the jtr/fix-mime-detection-tests branch December 23, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug feature: files tests Related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants