fix(LDStatusPro.user.js): prioritize summary stats over cloud cache for visit-day counters#36
Merged
caigg188 merged 2 commits intocaigg188:mainfrom Mar 12, 2026
Conversation
| // @name LDStatus Pro | ||
| // @namespace http://tampermonkey.net/ | ||
| // @version 3.5.5.8 | ||
| // @version 3.5.5.8.1 |
Contributor
Author
There was a problem hiding this comment.
这个是我当时测试的时候多加了一个数字,然后后面第二个 commit 的时候我又给删掉啦,因为 version 肯定还是需要 @caigg188 佬来决定的🫡
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对应 issue
#35
目的
修复“访问天数等指标长期不变化”的显示问题,如下图(这个是我加入 L 站的第 3 天,同时 L 站数据也可以看到我 visit 3 天了,因此判断为可能代码上有 bug)所示:

bug 分析
现有逻辑中云端数据优先且命中后直接返回,可能覆盖实时统计值;当云端未及时刷新时,用户会看到“访问天数不增加”等情况(如上图所示)。
解决方案
调整 fallback 数据源优先级,先读取了 LinuxDo summary.json 的实时统计,然后再回退云端同步数据。这样就避免了云端旧缓存数据被优先渲染,导致数据看起来没有变化。
测试结果
将修改后的版本代码重新加入油猴刷新 linux.do 以后,可以看到数据正常同步了
