##bug说明
-
Creator 版本: 2.4.2
-
目标平台:微信小游戏
-
重现方式:当存储空间快满时,从远程下载zip解压,解压时发现存储空间不足无法解压成功,从而导致引擎重新去下载zip包,重新去解压,一直循环三次后失败,无法进入游戏
adapter.js中的代码
unzipAndCacheBundle: function unzipAndCacheBundle(id, zipFilePath, cacheBundleRoot, onComplete) {
var time = Date.now().toString();
var targetPath = "".concat(this.cacheDir, "/").concat(cacheBundleRoot, "/").concat(time).concat(suffix++);
var self = this;
makeDirSync(targetPath, true);
unzip(zipFilePath, targetPath, function (err) {
if (err) { // 此时err打印的错误是fail the maximum size of the file storage limit is exceeded fail
rmdirSync(targetPath, true); // 这时删除的是解压的目标目录,但实际上这个目录还没有创建,微信api提示删除失败,从而也没有起到删除缓存的效果
onComplete && onComplete(err);
return;
}
...
...
}
};