Skip to content

Invalidate stale bboxes in coordinate mutators - #3108

Draft
khalilurrrahmanridoykhan wants to merge 2 commits into
Turfjs:masterfrom
khalilurrrahmanridoykhan:agent/invalidate-mutator-bboxes
Draft

Invalidate stale bboxes in coordinate mutators#3108
khalilurrrahmanridoykhan wants to merge 2 commits into
Turfjs:masterfrom
khalilurrrahmanridoykhan:agent/invalidate-mutator-bboxes

Conversation

@khalilurrrahmanridoykhan

Copy link
Copy Markdown
Contributor

What changed

  • removes cached bbox values recursively after flip, toMercator, toWgs84, and truncate change coordinates
  • preserves the existing clone-versus-mutate behavior
  • adds regression coverage for both default cloning and mutate: true
  • updates the truncate fixture that previously retained an invalid bbox

Why

These functions change coordinate positions but retained cached bounding boxes describing the pre-mutation geometry. A later bbox lookup could therefore return stale coordinates. This follows the behavior established in #3106 and reuses the recursive removeBbox helper introduced there.

Validation

  • pnpm --filter @turf/flip test — 9 passed
  • pnpm --filter @turf/projection test — 52 passed
  • pnpm --filter @turf/truncate test — 17 passed
  • TypeScript checks for all three packages
  • Prettier check on all changed sources/tests/fixture
  • ESLint on all changed TypeScript files
  • git diff --check
  • repository pre-commit hook

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant