danielgtaylor / danielgtaylor/python-betterproto

Mixed up functions and endpoints

Open
#457 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.8k
Forks
234
PR merge metrics
No merged PRs in 30d

Description

So I was testing this out with [national instrument's grpc-device](https://github.com/ni/grpc-device) and it works pretty well so thank you however I have noticed that once in a while 2 endpoints/destinations are mixed up (So far i've only caught this one example to be fair).
So for example let's say I have 2 functions for endpoints (sorry im relatively new to grpc as a whole so not sure if terminology is correct) they are `configure_spectrum_frequency_start_stop` and `configure_spectrum_frequency_center_span` . They have the following definitions:

configure_spectrum_frequency_start_stop( vi, start_frequency, stop_frequency )
configure_spectrum_frequency_center_span( vi, center_frequency, span )

When I call one it actually executes the other and vice versa. So lets say I call `configure_spectrum_frequency_start_stop`

await client.configure_spectrum_frequency_start_stop(
vi=vi,
start_frequency=990e6,
stop_frequency=101e6
)

What is actually being called/executed on server is

await client.configure_spectrum_frequency_center_span(
vi=vi,
center_frequency=990e6
span=101e6
)

and now let's say I call `configure_spectrum_frequency_center_span` with

await client.configure_spectrum_frequency_center_span(
vi=vi,
center_frequency=100e6
span=20e6
)

what actually ends up happening/being executed on server is

await client.configure_spectrum_frequency_start_stop(
vi=vi,
start_frequency=100e6,
stop_frequency=20e6
)

When the proto files are compiled with Googles standard grpc compiler they work fine however here there seems to be a mix up when compiled with the betterproto compiler. Does anyone know why or how this is happening? Is there something I can do to maybe help fix this. Like I said I'm brand new to grpc but maybe if someone points me in the right direction as to what may be occurring I may be able to help implement a fix.

Actually there's a couple other weird quirks where things seem to get "mixed up" but this is by far the biggest and best example of this type of mixup

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.