Skip to content

Ignore macOS AppleDouble/.DS_Store files when scanning projects (#68)#69

Draft
hatton wants to merge 1 commit into
V3from
fix/issue-68-appledouble
Draft

Ignore macOS AppleDouble/.DS_Store files when scanning projects (#68)#69
hatton wants to merge 1 commit into
V3from
fix/issue-68-appledouble

Conversation

@hatton

@hatton hatton commented Jul 16, 2026

Copy link
Copy Markdown
Member

[Claude Opus 4.8]

Problem

Fixes #68. When a lameta project is copied to a non-HFS+ volume — an external SSD, an exFAT/FAT drive, or a network share — macOS creates AppleDouble sidecar files named ._<originalname> (to preserve resource forks / xattrs) plus .DS_Store. These are binary, not XML.

lameta scanned them as project content. The reported failure: for a described file foo.jpg with its foo.jpg.meta, macOS also created ._foo.jpg and ._foo.jpg.meta. During folder scanning, ._foo.jpg was treated as a real file, and its metadata-companion lookup found the AppleDouble ._foo.jpg.meta, which was then parsed as XML → "Non-whitespace before first tag." and the project would not open. The reporter's workaround was to run dot_clean.

Fix

Add isMacOSMetadataFile() (matches the ._ AppleDouble prefix and the literal .DS_Store) and filter these files out at every scan site:

  • getAllFilesSync() — folder child-file scan + ProjectDocuments
  • FolderMetadataFile metadata-file fallback — don't rename a ._Foo.session AppleDouble into place as the real metadata file
  • Folder.runSanityCheck() — avoid a spurious "multiple project files" warning on these volumes
  • Folder.findZombieMetadataFiles() — same rename-into-place hazard

The matcher is deliberately narrow: it matches ._* and exactly .DS_Store, not every dotfile — so .gitignore, .env, etc. pass through untouched.

The Sessions//People/ directory scans in Project.ts were already safe (they filter by isDirectory(), and AppleDouble entries are files).

Tests

Unit tests for isMacOSMetadataFile (AppleDouble, .DS_Store, full-path basenames, and non-matches like .gitignore) and a temp-directory test confirming getAllFilesSync skips the junk and returns only the real files.

🤖 Generated with Claude Code

On non-HFS volumes (external SSDs, exFAT/FAT, network shares) macOS creates
AppleDouble sidecar files named "._<name>" plus ".DS_Store". These are binary,
not XML. lameta scanned them as project content: e.g. it found the AppleDouble
companion of a "foo.jpg.meta" file ("._foo.jpg.meta") and parsed it as XML,
producing "Non-whitespace before first tag." and failing to open the project.

Add isMacOSMetadataFile() and filter these files out at every scan site:
- getAllFilesSync() (folder child-file scan, ProjectDocuments)
- FolderMetadataFile metadata-file fallback (don't rename a "._Foo.session"
  AppleDouble into place as the real metadata file)
- Folder.runSanityCheck() (avoid spurious "multiple project files" warning)
- Folder.findZombieMetadataFiles() (same rename-into-place hazard)

Fixes #68

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hatton

hatton commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

[Claude Opus 4.8] Consulted Devin on 2026-07-16 up to commit f15a23ebf7ee645c9f43cf8a90527491f9857bf3. Devin found 0 Bugs and 0 Investigate flags (2 Informational items only, not actionable). No other review bots or CI are configured on this repo. Local quality gate green: typecheck, lint, full vitest suite (1124 passed / 5 skipped).

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