Single source of truth for geo coordinate formatting

Open
#839 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
frontend

Research direction

Start by comparing the client-side geo-coordinate formatting with the formatting returned by xforms-engine, including the manual padding and space removal described in the issue. Investigate how the engine's codec functions and client formatting can stay synchronized without assuming the codec must be exposed. Done means establishing a sustainable single source of truth that prevents formatting regressions and reactivity loops.

Written by the indexing model from the issue text.

Description

Description

We implemented a manual format for geo coordinates on the client side (padding integers with .0 and removing spaces). This was required to ensure the client's emitted value matches what xforms-engine returns, preventing a reactivity loop that was destroying in-flight map edits. Having formatting in both places isn't ideal, since it can easily regress.

Investigate the best architectural approach to establish a single source of truth for geo coordinate formatting.

  • Exposing the engine's internal codec functions was considered during the fix, but this doesn't cleanly fit the engine's current structure.
  • The solution doesn't strictly have to be sharing the codec, as long as we can find a sustainable way to keep the client and engine formatting in sync.
Dominant language
TypeScript
Stars
38
Forks
24
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getodk/web-forms

All issues in getodk/web-forms

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.