Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revalidate sort bug #647

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

UestcCarpediem
Copy link

@UestcCarpediem UestcCarpediem commented Jan 31, 2024

#646 修复在同步过程中,revalidate 时 lodash sortby 无法正常将 18-Dec-2019 16:41 格式的date排序导致 diff 添加了非预期的 dir

@fengmk2
Copy link
Member

fengmk2 commented Jan 31, 2024

得加个单测确保一下

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.82%. Comparing base (64bb78c) to head (2470621).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #647   +/-   ##
=======================================
  Coverage   96.82%   96.82%           
=======================================
  Files         180      180           
  Lines       17626    17630    +4     
  Branches     2293     2297    +4     
=======================================
+ Hits        17067    17071    +4     
  Misses        559      559           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@UestcCarpediem
Copy link
Author

得加个单测确保一下

又调整了一下,排序放在循环体内,复杂度为n平方,有超时风险。

@fengmk2 fengmk2 requested a review from elrrrrrrr March 8, 2024 04:03
@fengmk2 fengmk2 changed the title fix revalidate sort bug fix: revalidate sort bug Mar 8, 2024
@fengmk2 fengmk2 added the bug Something isn't working label Mar 8, 2024
@@ -250,6 +250,9 @@ export class BinarySyncerService extends AbstractService {
for (const item of existsItems) {
existsMap.set(item.name, item);
}
const latestItem = sortBy(fetchItems, item => {
return new Date(item.date);
}).pop();
Copy link
Member

Choose a reason for hiding this comment

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

如果 dir.endsWith(latestVersionParent) 不满足的时候时候不需要设置 🤔

@elrrrrrrr
Copy link
Member

@UestcCarpediem 用例修复下? 🙏🏻

@UestcCarpediem
Copy link
Author

@UestcCarpediem 用例修复下? 🙏🏻

好的

@UestcCarpediem
Copy link
Author

@UestcCarpediem 用例修复下? 🙏🏻
Node.js CI / test-mysql57-fs-nfs (16, ubuntu-latest) 这个用例报错好像是node16的CVE导致的
image

@elrrrrrrr elrrrrrrr mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants