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: skip log-source-maps for large files #5780

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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