Weird comparaison in log creation. #1715
-
I was investigating the log creation process and found some unexpected behavior in When it creates a route from the logs, it checks if the route already exists in the targeted environment: // check if route already exists
if (
!force &&
environmentHasRoute(targetEnvironment, {
endpoint,
method: log.method,
type: routeType
})
) {
return;
} However, why is the comparison using edit : I forgot to mention, but log.route needs to be null-checked first. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Thank you for reaching out! 👋We appreciate you taking the time to ask your question or report an issue. Please note that response times may vary as we work through requests. We'll get back to you as soon as possible. If you require priority support or enterprise assistance, you can explore our support options on mockoon.com. Alternatively, for a guaranteed fast response (usually within a day), you can purchase a one-time support request via GitHub Sponsors. Thank you for your patience and for being part of the Mockoon community! |
Beta Was this translation helpful? Give feedback.
-
Not sure to follow your reasoning, but |
Beta Was this translation helpful? Give feedback.
Indeed, but the code you linked to only makes sense (yet) when you want to mock endpoints that don't exist yet in your setup. In this case, the
route
will benull
. Also, when calling/non/existing/path
against your mock API we have no way to know if and which path section should be a route param.The
route
property is currently only used to inform the user if the route was caught or not, independently o…