Skip to content

Frontend/protobuf: Fix typing of [u]int64 types#8114

Closed
tristanlabelle wants to merge 2 commits into
developfrom
frontend/refactor/protos-int64-string
Closed

Frontend/protobuf: Fix typing of [u]int64 types#8114
tristanlabelle wants to merge 2 commits into
developfrom
frontend/refactor/protos-int64-string

Conversation

@tristanlabelle

Copy link
Copy Markdown
Contributor

Our protobuf typescript definitions used the number type for protobuf [u]int64 fields, but at runtime they were actually javascript strings (because the javascript number type is a double-precision floating point that cannot represent all uint64's).

Before:

export namespace GetSignupPageInfoRes {
  export type AsObject = {
    lastSignup?: google_protobuf_timestamp_pb.Timestamp.AsObject,
    lastLocation: string,
    userCount: number,
  }
} 

After:

export namespace GetSignupPageInfoRes {
  export type AsObject = {
    lastSignup?: google_protobuf_timestamp_pb.Timestamp.AsObject,
    lastLocation: string,
    userCount: string,
  }
}

Surprisingly, running yarn lint didn't find typing issues after this change. I suspect our code often coalesced values to string.

Fixes #8113

Testing

Regenerated protos, ran the frontend and clicked around. Validated the member count still shows properly. I imagine this would crash very fast if it was wrong.

image

Web frontend checklist

  • There are no console warnings when running the app
  • Added tests where relevant
  • Clicked around my changes running locally and it works
  • Checked Desktop, Mobile and Tablet screen sizes

For maintainers

  • Maintainers can push commits to my branch
  • Maintainers can merge this PR for me

@vercel

vercel Bot commented Mar 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
couchers Error Error Mar 17, 2026 0:04am

Request Review

@nabramow

Copy link
Copy Markdown
Member

@tristanlabelle Same here is this still in progress?

@tristanlabelle

Copy link
Copy Markdown
Contributor Author

@nabramow Still on my backlog but I can find the PR back via the issue so I can close for now.

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.

Protocol buffer typescript for uint64 is incorrect

2 participants