Skip to content

Conversation

@mtfum
Copy link
Contributor

@mtfum mtfum commented Nov 13, 2025

Motivation:

  • The Route Guide tutorial had several compilation errors and missing implementations that prevented users from successfully following the tutorial. These issues included:
  • Generic Client type being used directly in method signatures, causing compilation errors
  • Missing Notes class implementation that was referenced but not defined
  • Incorrect property access patterns using .message accessor
  • Step numbering gaps that made the tutorial confusing to follow
  • loadFeatures being incorrectly defined as a private static method instead of an internal instance method

Modifications:

  • Fixed compilation errors: Changed Client to ClientProtocol in method signatures across unary, server streaming, client streaming, and bidirectional streaming examples to fix generic type compilation issues
  • Fixed step numbering: Corrected the step sequence to remove gaps (step 7 was previously skipped)
  • Added missing Notes class: Implemented the thread-safe Notes class with Mutex for storing RouteNote messages, including recordNote method and receivedNotes property in RouteGuideService
  • Fixed property access: Removed incorrect .message accessor from request.latitude and request.longitude across all tutorial examples (unary, server streaming, client streaming)
  • Fixed method definition: Changed loadFeatures from a static method to an instance method and changed its visibility from private to internal to make it accessible from extension files

Result:

The Route Guide tutorial now compiles successfully and provides complete, working examples for all four gRPC call types (unary, server streaming, client streaming, and bidirectional streaming).
Users can follow the tutorial from start to finish without encountering compilation errors or missing implementations.

A working sample implementation following this tutorial is available at https://github.com/mtfum/RouteGuide/.

Remove .message accessor from request.latitude and request.longitude
across unary, server streaming, and client streaming examples.
Motivation:

The Notes class was referenced but not implemented in the Route Guide
tutorial step 10. This adds the missing thread-safe Notes class that
stores RouteNote messages.

Modifications:

- Added Notes class with Mutex for thread-safe storage of RouteNote
  messages
- Added recordNote method to store notes and return notes from the
  same location
- Added receivedNotes property to RouteGuideService

Result:

The Notes class is now properly implemented, allowing the routeChat
method to store and retrieve notes in a thread-safe manner.
Step 7 was skipped in the original sequence.
This fixes the step numbering to be sequential without gaps.
Client is generic and cannot be used directly in method signatures.
Use ClientProtocol instead to fix compilation errors in tutorial examples.
Copy link
Collaborator

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

This is great, thank you. I left one comment which needs resolving in multiple places.

@glbrntt glbrntt added the semver/none No version bump required. label Nov 14, 2025
Copy link
Collaborator

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

The formatter is unhappy now, running ./dev/format.sh should fix it

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

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants