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: bundless cache maybe broken if has dts error #725

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

PeachScript
Copy link
Member

@PeachScript PeachScript commented Oct 20, 2023

修复 bundless 的持久缓存可能损坏导致下一次构建直接报错的问题

原因是写缓存的操作是异步进行的,会出现在内容还未完全写入文件系统的时候就遇到 dts error 进程退出,导致缓存内容不可用;解决方案是 bundless loader 处理文件时,等缓存完全写入后再 resolve,这样 dts 始终作为 loader 的后置逻辑执行,即便异常终止也不会影响 loader 缓存的有效性

cc @hualigushi

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b13bc23) 94.42% compared to head (bce9518) 94.43%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #725   +/-   ##
=======================================
  Coverage   94.42%   94.43%           
=======================================
  Files          55       55           
  Lines        1561     1562    +1     
  Branches      351      373   +22     
=======================================
+ Hits         1474     1475    +1     
+ Misses         87       82    -5     
- Partials        0        5    +5     
Files Coverage Δ
src/builder/bundless/loaders/index.ts 80.95% <100.00%> (ø)
src/doctor/parser.ts 100.00% <100.00%> (ø)
src/utils.ts 98.75% <100.00%> (+0.01%) ⬆️

... and 4 files with indirect coverage changes

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

@PeachScript PeachScript merged commit 63d2243 into master Oct 20, 2023
9 checks passed
@delete-merged-branch delete-merged-branch bot deleted the hotfix/invalid-cache-when-error branch October 20, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant