Skip to content

Build #107: 支持更新文件创建人信息 - #109

Merged
nil4u merged 2 commits into
developfrom
107-file-id/build
Aug 25, 2026
Merged

nil4u merged 2 commits into
developfrom
107-file-id/build

Conversation

@nil4u

@nil4u nil4u commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Source issue

Summary

  • Add PUT /v1/files/{fileId}/creator to independently update any subset of cuid, cu_name, and millisecond created_at.
  • Require at least one field; explicitly supplied null, blank names, negative IDs, and negative timestamps return parameter errors before persistence.
  • Persist only fields actually present in the request, leaving omitted creator fields, business fields, updater audit fields, and file version unchanged.
  • Return the refreshed file and broadcast file.updated with the dedicated creator scope for both single-field and multi-field updates.
  • Rebased onto the latest 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

@nil4u nil4u added the mr-by::build PR or MR was created by the build action label Aug 25, 2026 — with agentrix-ai
@Jiakaic

Jiakaic commented Aug 25, 2026

Copy link
Copy Markdown
Member

@claude 检查提交的代码,使用中文回复

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@nil4u
nil4u force-pushed the 107-file-id/build branch from f8deb3f to 6af6ff4 Compare August 25, 2026 04:33
@nil4u
nil4u merged commit d1be90b into develop Aug 25, 2026
1 check passed
@nil4u
nil4u deleted the 107-file-id/build branch August 25, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mr-by::build PR or MR was created by the build action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants