Skip to content

fix: round listing locations to about 1 km - #100

Merged
DCT-Berinyuy merged 1 commit into
devfrom
fix/coarse-listing-location
Oct 6, 2026
Merged

DCT-Berinyuy merged 1 commit into
devfrom
fix/coarse-listing-location

Conversation

@DCT-Berinyuy

Copy link
Copy Markdown
Collaborator

Summary

Listings stored the seller's exact GPS position and showed it as a map pin to every user. This rounds listing coordinates to 2 decimals (about 1.1 km) in the database, so Play's "shares precise location with other users" answer can honestly be No. This is a database-only change, so no app rebuild is needed.

Closes #

Changes

  • supabase/migrations/20261020000000_coarse_listing_location.sql:
    • public.coarsen_listing_location() trigger function (search_path = '').
    • BEFORE INSERT OR UPDATE OF latitude, longitude trigger on public.listings.
    • One-time backfill of existing rows. Idempotent.
  • Meetup coordinates are unchanged: they are user-chosen public spots, already rounded to 3 decimals by the app.
  • bookbridge-rust-core/tests/listing_location_tests.rs: insert and update rounding, nulls preserved, migration re-run rounds existing precise rows.
  • Website privacy policy now discloses the approximate (about 1 km) listing location.
  • CHANGELOG Unreleased entry.

Test plan

  • cargo fmt (touched files) and cargo clippy pass
  • cargo test: the new DB tests skip locally (no local Postgres) and run in CI only
  • Migration is idempotent; the re-run is covered by a test (CI)
  • Distance sort on Home is computed client-side, so it still works at about 1 km precision.

Checklist

  • Targets dev, not main
  • No secrets, keys, or personal data in code, logs, or screenshots
  • User input is validated; new tables have RLS policies (no new tables)
  • User-facing strings added to both EN and FR ARB files (no app strings changed)
  • Docs updated if behavior changed

Screenshots

N/A

Adds a BEFORE INSERT/UPDATE trigger on public.listings that rounds
latitude/longitude to 2 decimals and backfills existing rows, so other
users never see a seller's exact GPS position. Discloses approximate
location in the website privacy policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
book-bridge Ready Ready Preview Oct 6, 2026 10:44pm UTC

@DCT-Berinyuy
DCT-Berinyuy merged commit a86f874 into dev Oct 6, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 028f695a Deployed Oct 6, 2026 by vercel[bot]
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