Skip to content

Commit

Permalink
fix: skip log-source-maps for large files (#5780)
Browse files Browse the repository at this point in the history
  • Loading branch information
rigor789 authored Jan 17, 2024
1 parent 3d5891a commit c53b4e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/services/log-source-map-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ export class LogSourceMapService implements Mobile.ILogSourceMapService {
if (!this.$fs.getFsStats(filePath).isDirectory()) {
const mapFile = filePath + ".map";
let sourceMapRaw;

// Skip files bigger than 50MB
if (this.$fs.getFileSize(filePath) > 50 * 1000 * 1000) {
this.$logger.trace(
`Skipping source map for file ${filePath} because it is too big (> 50MB).`
);
return;
}

const source = this.$fs.readText(filePath);
if (this.$fs.exists(mapFile)) {
sourceMapRaw = sourceMapConverter.fromMapFileSource(
Expand Down

0 comments on commit c53b4e9

Please sign in to comment.