Repository: syncthing/syncthing (language: go)

Issue:
Fails to sync file with changes to data + xattrs
 - v1.22.2-rc.1
 - macOS 13.0.1

I compiled a custom build for macOS to work around #8657, which is definitely making progress. But I think there may be a side effect or regression now, because although I can get my 2 machines to agree when they are 100% synced, I am now facing a new issue: changes on Mac-A are not fully propagating to Mac-B.

Syncthing is copying the file over to the right place, and naming it `.syncthing.foo.tmp` but the rename never happens, so I'm now getting **Out of Sync** errors. I enabled some additional Debug Facilities on Mac-B (`app`, `fs`, `main`, `walkfs` and `watchaggregator`) and here's what I'm seeing:

```
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 folderconfiguration.go:267 basic /Users/luke/Sync Usage . {130006044672 250790436864} <nil>
2022-11-10 16:57:18 folderconfiguration.go:267 basic /Users/luke/Sync Usage . {130006040576 250790436864} <nil>
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 folderconfiguration.go:267 basic /Users/luke/Sync Usage . {130006044672 250790436864} <nil>
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 folderconfiguration.go:267 basic /Users/luke/Sync Usage . {130006036480 250790436864} <nil>
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:57:18 Puller (folder "Sync" (abcde-zyxwv), item "Obsidian/Main/how to compile syncthing-macos from source.md"): syncing: finishing: setting metadata: set xattrs Obsidian/Main/how to compile syncthing-macos from source.md: GetXattr: get xattr /Users/luke/Sync/Obsidian/Main/how to compile syncthing-macos from source.md: Listxattr /Users/luke/Sync/Obsidian/Main/how to compile syncthing-macos from source.md: no such file or directory
2022-11-10 16:57:18 Puller (folder "Sync" (abcde-zyxwv), item "Scripts/syncthing-api-status.sh"): syncing: finishing: setting metadata: set xattrs Scripts/syncthing-api-status.sh: GetXattr: get xattr /Users/luke/Sync/Scripts/syncthing-api-status.sh: Listxattr /Users/luke/Sync/Scripts/syncthing-api-status.sh: no such file or directory
2022-11-10 16:57:18 Puller (folder "Sync" (abcde-zyxwv), item "Scripts/syncthing-sync-check.sh"): syncing: finishing: setting metadata: set xattrs Scripts/syncthing-sync-check.sh: GetXattr: get xattr /Users/luke/Sync/Scripts/syncthing-sync-check.sh: Listxattr /Users/luke/Sync/Scripts/syncthing-sync-check.sh: no such file or directory
2022-11-10 16:57:18 Puller (folder "Sync" (abcde-zyxwv), item "Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md"): syncing: finishing: setting metadata: set xattrs Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md: GetXattr: get xattr /Users/luke/Sync/Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md: Listxattr /Users/luke/Sync/Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md: no such file or directory
2022-11-10 16:57:18 "Sync" (abcde-zyxwv): Failed to sync 4 items
2022-11-10 16:57:18 Folder "Sync" (abcde-zyxwv) isn't making sync progress - retrying in 32m2s.
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:57:18 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/how to compile syncthing-macos from source.md non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Creating eventDir at: Obsidian
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Creating eventDir at: Obsidian/Main
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Resetting notifyTimer to 10s
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/how to compile syncthing-macos from source.md non-remove
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/how to compile syncthing-macos from source.md non-remove
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/how to compile syncthing-macos from source.md non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md non-remove
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-api-status.sh non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Creating eventDir at: Scripts
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Scripts/syncthing-api-status.sh
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-api-status.sh
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-api-status.sh non-remove
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-api-status.sh non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-api-status.sh
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-api-status.sh non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-api-status.sh
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-sync-check.sh non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Scripts/syncthing-sync-check.sh
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-sync-check.sh
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-sync-check.sh non-remove
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-sync-check.sh non-remove
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-sync-check.sh
2022-11-10 16:58:20 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-sync-check.sh
2022-11-10 16:58:20 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-sync-check.sh non-remove
2022-11-10 16:58:30 aggregator/"Sync" (abcde-zyxwv): Notifying about 4 fs events
2022-11-10 16:58:30 aggregator/"Sync" (abcde-zyxwv): Resetting notifyTimer to 10s
2022-11-10 16:58:30 folderconfiguration.go:116 basic /Users/luke/Sync Stat . {0xc007e240d0} <nil>
2022-11-10 16:58:30 folderconfiguration.go:134 basic /Users/luke/Sync Stat .stfolder {0xc007e24340} <nil>
2022-11-10 16:58:30 folder.go:334 basic /Users/luke/Library/Application Support/Syncthing/index-v0.14.0.db Usage . {130006024192 250790436864} <nil>
2022-11-10 16:58:30 walk: path=Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:30 walk: path=Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:30 walk: path=Scripts/syncthing-api-status.sh
2022-11-10 16:58:30 walk: path=Scripts/syncthing-sync-check.sh
2022-11-10 16:58:30 folderconfiguration.go:116 basic /Users/luke/Sync Stat . {0xc0023f0750} <nil>
2022-11-10 16:58:30 folderconfiguration.go:134 basic /Users/luke/Sync Stat .stfolder {0xc0023f09c0} <nil>
2022-11-10 16:58:30 folder.go:334 basic /Users/luke/Library/Application Support/Syncthing/index-v0.14.0.db Usage . {130006016000 250790436864} <nil>
2022-11-10 16:58:31 folderconfiguration.go:116 basic /Users/luke/Sync Stat . {0xc00079a000} <nil>
2022-11-10 16:58:31 folderconfiguration.go:134 basic /Users/luke/Sync Stat .stfolder {0xc00079a270} <nil>
2022-11-10 16:58:31 folder.go:334 basic /Users/luke/Library/Application Support/Syncthing/index-v0.14.0.db Usage . {130006007808 250790436864} <nil>
2022-11-10 16:58:31 folderconfiguration.go:116 basic /Users/luke/Sync Stat . {0xc00079a750} <nil>
2022-11-10 16:58:31 folderconfiguration.go:134 basic /Users/luke/Sync Stat .stfolder {0xc00079a9c0} <nil>
2022-11-10 16:58:31 folder.go:334 basic /Users/luke/Library/Application Support/Syncthing/index-v0.14.0.db Usage . {130006007808 250790436864} <nil>
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md non-remove
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Skipping path we modified: Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Skipping path we modified: Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Obsidian/Main/Troubleshooting syncthing Out of Sync issues.md non-remove
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Obsidian/Main/how to compile syncthing-macos from source.md non-remove
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Creating eventDir at: Obsidian
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Creating eventDir at: Obsidian/Main
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Obsidian/Main/how to compile syncthing-macos from source.md non-remove
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-sync-check.sh non-remove
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Creating eventDir at: Scripts
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Scripts/syncthing-sync-check.sh
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-api-status.sh non-remove
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Tracking (type non-remove): Scripts/syncthing-api-status.sh
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-api-status.sh non-remove
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-api-status.sh
2022-11-10 16:58:31 basic /Users/luke/Sync Watch: Sending Scripts/syncthing-sync-check.sh non-remove
2022-11-10 16:58:31 aggregator/"Sync" (abcde-zyxwv): Already tracked (type non-remove): Scripts/syncthing-sync-check.sh
2022-11-10 16:58:40 aggregator/"Sync" (abcde-zyxwv): Notifying about 3 fs events
2022-11-10 16:58:40 aggregator/"Sync" (abcde-zyxwv): Resetting notifyTimer to 10s
2022-11-10 16:58:40 folderconfiguration.go:116 basic /Users/luke/Sync Stat . {0xc008b32000} <nil>
2022-11-10 16:58:40 folderconfiguration.go:134 basic /Users/luke/Sync Stat .stfolder {0xc008b32270} <nil>
2022-11-10 16:58:40 folder.go:334 basic /Users/luke/Library/Application Support/Syncthing/index-v0.14.0.db Usage . {130005958656 250790436864} <nil>
2022-11-10 16:58:40 walk: path=Obsidian/Main/how to compile syncthing-macos from source.md
2022-11-10 16:58:40 walk: path=Scripts/syncthing-api-status.sh
2022-11-10 16:58:40 walk: path=Scripts/syncthing-sync-check.sh
2022-11-10 16:58:49 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-sync-check.sh.tmp
2022-11-10 16:58:49 basic /Users/luke/Sync Watch: Ignoring Scripts/.syncthing.syncthing-api-status.sh.tmp
2022-11-10 16:58:49 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.Troubleshooting syncthing Out of Sync issues.md.tmp
2022-11-10 16:58:49 basic /Users/luke/Sync Watch: Ignoring Obsidian/Main/.syncthing.how to compile syncthing-macos from source.md.tmp
2022-11-10 16:58:50 aggregator/"Sync" (abcde-zyxwv): No tracked events, waiting for new event.
2022-11-10 17:04:36 tempfile.go:51 basic /Users/luke/Library/Application Support/Syncthing OpenFile .syncthing.tmp.805484550 2562 -rw------- {0xc005cce0a0 .syncthing.tmp.805484550} <nil>
2022-11-10 17:04:36 atomic.go:94 basic /Users/luke/Library/Application Support/Syncthing Lstat csrftokens.txt {0xc001fde1a0} <nil>
2022-11-10 17:04:36 atomic.go:99 basic /Users/luke/Library/Application Support/Syncthing Rename .syncthing.tmp.805484550 csrftokens.txt <nil>
2022-11-10 17:04:36 atomic.go:112 basic /Users/luke/Library/Application Support/Syncthing Chmod csrftokens.txt -rw------- <nil>
2022-11-10 17:04:36 atomic.go:119 basic /Users/luke/Library/Application Support/Syncthing Open . {0xc005cce0a8 .} <nil>
2022-11-10 17:04:36 atomic.go:127 basic /Users/luke/Library/Application Support/Syncthing Remove .syncthing.tmp.805484550 remove /Users/luke/Library/Application Support/Syncthing/.syncthing.tmp.805484550: no such file or directory
```


Discussion / hints:
Not sure if it matters, but 

### Mac-A:
- Mac Mini M1 2020
- macOS 13.0.1

### Mac-B:
- Intel MacBook Air 2015
- macOS 12.6.1
Actual smoking gun:

```
2022-11-10 16:57:18 Puller (folder "Sync" (abcde-zyxwv), item "Scripts/syncthing-api-status.sh"):
 syncing: finishing: setting metadata:
 set xattrs Scripts/syncthing-api-status.sh: GetXattr:
 get xattr /Users/luke/Sync/Scripts/syncthing-api-status.sh:
 Listxattr /Users/luke/Sync/Scripts/syncthing-api-status.sh:
 no such file or directory
```


Fix patch:
diff --git a/lib/model/folder_sendrecv.go b/lib/model/folder_sendrecv.go
index 6adb6f5d8bd..6111bc42576 100644
--- a/lib/model/folder_sendrecv.go
+++ b/lib/model/folder_sendrecv.go
@@ -2120,7 +2120,7 @@ func (f *sendReceiveFolder) checkToBeDeleted(file, cur protocol.FileInfo, hasCur
 func (f *sendReceiveFolder) setPlatformData(file *protocol.FileInfo, name string) error {
 	if f.SyncXattrs {
 		// Set extended attributes.
-		if err := f.mtimefs.SetXattr(file.Name, file.Platform.Xattrs(), f.XattrFilter); errors.Is(err, fs.ErrXattrsNotSupported) {
+		if err := f.mtimefs.SetXattr(name, file.Platform.Xattrs(), f.XattrFilter); errors.Is(err, fs.ErrXattrsNotSupported) {
 			l.Debugf("Cannot set xattrs on %q: %v", file.Name, err)
 		} else if err != nil {
 			return err


Test patch:
diff --git a/lib/model/folder_test.go b/lib/model/folder_test.go
index e3482883603..38036ca95f6 100644
--- a/lib/model/folder_test.go
+++ b/lib/model/folder_test.go
@@ -14,6 +14,8 @@ import (
 
 	"github.com/syncthing/syncthing/lib/build"
 	"github.com/syncthing/syncthing/lib/config"
+	"github.com/syncthing/syncthing/lib/fs"
+	"github.com/syncthing/syncthing/lib/protocol"
 )
 
 type unifySubsCase struct {
@@ -149,3 +151,43 @@ func BenchmarkUnifySubs(b *testing.B) {
 		}
 	}
 }
+
+func TestSetPlatformData(t *testing.T) {
+	// Checks that setPlatformData runs without error when applied to a temp
+	// file, named differently than the given FileInfo.
+
+	dir := t.TempDir()
+	fs := fs.NewFilesystem(fs.FilesystemTypeBasic, dir)
+	if fd, err := fs.Create("file.tmp"); err != nil {
+		t.Fatal(err)
+	} else {
+		fd.Close()
+	}
+
+	xattr := []protocol.Xattr{{Name: "user.foo", Value: []byte("bar")}}
+	fi := &protocol.FileInfo{
+		Name:        "should be ignored",
+		Permissions: 0400,
+		ModifiedS:   1234567890,
+		Platform: protocol.PlatformData{
+			Linux:   &protocol.XattrData{Xattrs: xattr},
+			Darwin:  &protocol.XattrData{Xattrs: xattr},
+			FreeBSD: &protocol.XattrData{Xattrs: xattr},
+			NetBSD:  &protocol.XattrData{Xattrs: xattr},
+		},
+	}
+
+	// Minimum required to support setPlatformData
+	sr := &sendReceiveFolder{
+		folder: folder{
+			FolderConfiguration: config.FolderConfiguration{
+				SyncXattrs: true,
+			},
+			mtimefs: fs,
+		},
+	}
+
+	if err := sr.setPlatformData(fi, "file.tmp"); err != nil {
+		t.Error(err)
+	}
+}