Skip to content

Commit 2d494eb

Browse files
committed
add comment for duplicate dynamic routes
1 parent e71268b commit 2d494eb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/event-handler/src/rest/RouteHandlerRegistry.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ class RouteHandlerRegistry {
111111
this.#logger.warn(
112112
`Handler for method: ${route.method} and path: ${route.path} already exists. The previous handler will be replaced.`
113113
);
114+
// as dynamic routes are stored in an array, we can't rely on
115+
// overwriting a key in a map like with static routes so have
116+
// to manually manage duplicate routes
114117
const index = this.#dynamicRoutesIndexMap.get(route.id)!;
115118
this.#dynamicRoutes.splice(index, 1);
116119
}

0 commit comments

Comments
 (0)