Ambassador
Ambassador copied to clipboard
Router mixing similar routes
Possible bug in Router, we have an api with two very similar paths /api/GetDevices and /api/GetDevice, while trying to ui test in iOS after setting up a response for each endpoint some times we're getting GetDevice's response for a call to GetDevices which makes the tests crash as the response is different and cannot be parsed by our app. I think the problem is in the matcher that sometimes is mixing responses in case of similar routes like ours.
I'm seeing this as well -- in my case /workoutConfig
is matching the /workout
route. It appears to be variable as well -- sometimes it happens and sometimes it doesn't.
So I took a look at the router and created some tests--turns out this is by design: paths are always treated as a regular expression. (Of course I realize now I should have clicked through to the above mentioned issue. 😂)