Skip to content

Conversation

xrgzs
Copy link
Member

@xrgzs xrgzs commented Aug 27, 2025

Description / 描述

  1. 将原来的 size 变量改为更具体的 fileSize,提升代码可读性。
  2. 修正了 sliceSize 的计算方式,确保分片大小不会等于文件大小,避免上传异常。
  3. 相关分片处理逻辑(如分片计数、最后一片大小、分片读取等)全部用更明确的变量名和逻辑替换,注释也更清晰。
  4. 保证 sliceSize 参数始终为特定分片大小,避免与文件大小混淆。

Motivation and Context / 背景

Closes #1126

How Has This Been Tested? / 测试

image

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

@xrgzs xrgzs added bug Something isn't working go Pull requests that update go code labels Aug 27, 2025
@xrgzs xrgzs requested review from Copilot and j2rong4cn August 27, 2025 10:00
Copilot

This comment was marked as outdated.

@ILoveScratch2 ILoveScratch2 requested a review from Copilot August 27, 2025 10:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where sliceSize could equal fileSize causing upload failures. The changes improve code readability by using more descriptive variable names and ensure proper slice size calculation for file uploads.

  • Rename size variable to more descriptive fileSize throughout the upload logic
  • Modify sliceSize calculation to ensure it's never equal to file size
  • Update all related slice processing logic to use clearer variable names and comments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@xrgzs xrgzs changed the title fix(189pc): sliceSize not equal to fileSize fix(189pc): sliceSize must not be equal to fileSize Aug 27, 2025
@xrgzs xrgzs merged commit f350ccd into OpenListTeam:main Aug 28, 2025
12 checks passed
@xrgzs xrgzs deleted the fix/189pc-slicesize branch August 28, 2025 03:32
@xrgzs xrgzs linked an issue Aug 29, 2025 that may be closed by this pull request
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go Pull requests that update go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] 从 4.1.0 升级到 4.1.1 后,天翼云盘家庭云无法上传文件 天翼云不能上传文件
2 participants