getappmap / getappmap/appmap-ruby

`normalized_path` may be wrong if the path matches many potential routes

Open
#316 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
101
Forks
13
PR merge metrics
No merged PRs in 30d

Description

E.g. given the following routes.rb:

get 'api/users'
get ':team_slug/users'

It appears possible for a call to /api/users to return a normalized path of /:team_slug/users incorrectly when the path matches the route definition.

https://github.com/getappmap/appmap-ruby/blob/master/lib/appmap/handler/rails/request_handler.rb#L59-L66

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/appmap/handler/rails/request_handler.rb at lines 59-66 and reproduce the routes shown in routes.rb with a request to /api/users. Compare the normalized path against the route that actually matched. Done means the specific route remains the normalized result even when another dynamic route could also match.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.