Skip to content

fix(sheets): resolve spreadsheet import potential freeze#319

Merged
regeter merged 1 commit into
googlemaps:mainfrom
regeter:main
May 21, 2026
Merged

fix(sheets): resolve spreadsheet import potential freeze#319
regeter merged 1 commit into
googlemaps:mainfrom
regeter:main

Conversation

@regeter
Copy link
Copy Markdown
Contributor

@regeter regeter commented May 21, 2026

Importing Google Sheet log datasets that contain numeric string keys locks up the browser.

Root Cause:
Lodash's _.set interprets integer-like string keys in the sheet headers (e.g., "819054441") as numeric array indices. This creates massive sparse arrays of 800M+ elements. Re-serializing and running recursive normalization mappings over these giant sparse arrays freezes the CPU for ~15.8 seconds per row.

Solution

Standard nested arrays in this app are written to single cells as JSON arrays and never flattened, so any numeric keys in sheet headers represent object map keys (like trip IDs) rather than array indexes.

  • Replaced _.set with a custom setDeep function instantiation.
  • Removed the now-unused lodash import and dependency

@regeter regeter merged commit 312d16a into googlemaps:main May 21, 2026
7 checks passed
Comment thread src/GoogleSheets.js
}
current = current[key];
}
current[segments[segments.length - 1]] = value;
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.36.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants