Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add elevation to shared client #529

Merged
merged 6 commits into from
May 13, 2024
Merged

feat: add elevation to shared client #529

merged 6 commits into from
May 13, 2024

Conversation

paulschreiber
Copy link
Member

@paulschreiber paulschreiber commented May 7, 2024

Description

Add elevation to shared client

Related issues

Backend: techmatters/terraso-backend#1286

@paulschreiber paulschreiber requested a review from shrouxm May 7, 2024 20:17
Copy link
Member

@shrouxm shrouxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

should note that as is this'll be a breaking change for the mobile client due to elevation being a required field on the backend, so we shouldn't merge it until we're ready to make that associated change in the mobile client

@paulschreiber
Copy link
Member Author

@shrouxm @tm-ruxandra making elevation optional broke the type checking:

  Types of property 'elevation' are incompatible.
    Type 'number | null | undefined' is not assignable to type 'number | undefined'.
      Type 'null' is not assignable to type 'number | undefined'.

I now allow elevation to be null:

  elevation?: number | null;

Is that the right fix?

@shrouxm
Copy link
Member

shrouxm commented May 13, 2024

yes i think so right now

it's an ongoing tech-debt issue that the client types and the backend don't quite agree, so the client right now is configured to be generous in what it accepts. eventually i'd like to make it so that it's just either elevation: Site | null or elevation?: Site, because i think there's only one case where it'd be absent, but i'm not sure which if that's the case or which one makes more sense which is why i haven't done it

@paulschreiber paulschreiber merged commit d1f8187 into main May 13, 2024
7 checks passed
@paulschreiber paulschreiber deleted the feat/elevation branch May 13, 2024 22:21
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.

2 participants