Conversation
AlexCXC
force-pushed
the
opt-query-activities
branch
from
July 23, 2026 06:45
4b652f4 to
3e1728d
Compare
seafile-dev
requested changes
Aug 7, 2026
seafile-dev
left a comment
There was a problem hiding this comment.
Verdict: Request changes
Blocking:
- The activity-day boundary and cache key are wrong for offsets with non-zero minutes; see the inline comment.
Warnings:
- No regression coverage was added for cache hit/miss behavior, empty historical days, the current-day bypass, or minute-offset zones.
Suggested fix: add focused unit tests around the day-range/query helpers and a Redis stub covering +05:30 and -03:30, including an instant that crosses the requested local midnight.
| if not match: | ||
| raise ValueError("Offset format must be like '+8:00' or '-9:00'") | ||
|
|
||
| sign = 1 if match.group(1) == '+' else -1 |
There was a problem hiding this comment.
[Critical] 分钟级时区被忽略
Why this matters:
to_tz 来自前端的 dayjs().format().slice(-6),会包含如 +05:30 的有效偏移;这里仅使用小时构造 Etc/GMT,完全丢弃分钟。比如 UTC 18:45 在 +05:30 已是次日 00:15,但实现仍按 +05:00 归到前一天,因此查询范围、返回日期和 Redis key 都会落在错误的自然日,并会把错误统计缓存 24 小时。
Suggested fix: 解析并保留 hours 和 minutes,使用 pytz.FixedOffset(sign * (hours * 60 + minutes))(或等价的固定偏移 tzinfo),并补充跨本地午夜的 +05:30/负分钟偏移回归测试。
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.
No description provided.