Repository navigation
Build #107: 支持更新文件创建人信息 - #109
Conversation
|
@claude 检查提交的代码,使用中文回复 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ccca07da2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| FileType fileType = FileType.fromFileId(fileId); | ||
| fileRepo.updateCreatorInfo(fileId, cuid, cuName, ctime); | ||
| FileDB fileDB = fileRepo.queryFile(fileId, fileType); | ||
| return broadcastFileUpdated(fileDB, Scope.CREATOR); |
There was a problem hiding this comment.
Preserve updater audit fields during creator broadcasts
For every broadcast-eligible user file, this call reaches broadcast(), whose success or failure callback invokes updateBroadcastStatus() and then FileRepo.updateFile(); that update unconditionally calls fillUpdatorInfo(). NoBroadcastService runs the success callback synchronously, and the Kafka implementation runs one asynchronously, so a creator-only request also overwrites muid, mu_name, and mtime, contrary to the intended creator-only persistence. Use a broadcast-status update path that does not populate updater audit fields for this operation.
Useful? React with 👍 / 👎.
|
|
||
| private LocalDateTime toLocalDateTime(Long timestamp) { | ||
| try { | ||
| LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()); |
There was a problem hiding this comment.
Preserve epoch milliseconds across DST overlaps
When the JVM default zone observes daylight saving time and created_at falls in the second occurrence of an overlapped local time, converting the instant to LocalDateTime discards which offset was supplied. transferToOpenAIFile() later obtains the zone's default offset for that local time, which is typically the earlier offset, so the response and subsequent reads can shift the submitted timestamp by an hour. For example, in America/New_York, 2024-11-03T06:30Z is stored as 01:30 and read back as 05:30Z; preserve the instant/offset or explicitly handle ambiguous times.
Useful? React with 👍 / 👎.
f8deb3f to
6af6ff4
Compare
Source issue
Summary
PUT /v1/files/{fileId}/creatorto independently update any subset ofcuid,cu_name, and millisecondcreated_at.null, blank names, negative IDs, and negative timestamps return parameter errors before persistence.file.updatedwith the dedicatedcreatorscope for both single-field and multi-field updates.develop, including the file metadata update changes from Build #106: 支持单独更新 file metadata #108.Validation
cd api && mvn test— 209 tests passed after rebase.cd api && mvn -Dtest=FileControllerUpdateCreatorTest,FileRepoUpdateTransactionTest,FileServiceBroadcastTest test— 31 tests passed after rebase.git diff --check