AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Dashboard CSV Import Hangs When Geometry Column Contains Rows With More Than 1000 Points

Importing a CSV file with a geometry column where individual rows have a large number of points (over approximately 1000) causes the Supabase dashboard import process to hang. This prevents data import for such rows and requires manual splitting or exclusion.

highConfidence 75%React

Origin Analysis

The CSV import component in the dashboard likely performs synchronous parsing and validation of geometry strings (e.g., GeoJSON or WKT) on the main thread. When a row contains a geometry with many points, the parsing (e.g., JSON.parse or complex string operations) becomes computationally expensive and blocks the UI, leading to an unresponsive hang. The lack of a size threshold or asynchronous processing allows arbitrarily large geometries to overload the browser.
1. Create a CSV file with a column named 'geometry' (or any geometry column). 2. Include at least one row where the geometry value is a GeoJSON or WKT representation with more than 1000 points (e.g., a long LineString or Polygon). 3. Use the Supabase dashboard to import the CSV into a table with a geometry column. 4. Observe that the import process hangs and does not complete. 5. Reattempt with rows containing <= 1000 points; import succeeds.

Fixing Code Block

Edge Case Audit

This fix may reject legitimate rows with geometries containing more than 1000 points, leading to data loss if the user ignores the error. The heuristic count may be inaccurate for complex geometries (e.g., nested arrays) or alternative formats, potentially allowing a hang if the estimate is too low, or unnecessarily rejecting rows if too high. The threshold is hardcoded and not user-configurable in this snippet; it should be exposed as a setting. Rollback: removing this check will restore the original behavior but reintroduce the hang. A proper fix should implement a Web Worker for parsing or stream processing to handle large geometries without blocking the UI.

Ecosystem Topology