binding.b doesn't stop code on second controller request and above

Open
#1,051 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rails, ruby
Domain
devtools

Research direction

Start by reproducing the issue in a Rails controller's #create action with binding.break, using the Ruby 3.3.0, Rails 7.1.2, and debug 1.9.1 versions reported. Trace the debugger's request lifecycle and verify that the breakpoint stops execution on the first and every subsequent request without restarting the server.

Written by the indexing model from the issue text.

Description

Your environment

Ruby 3.3.0
Rails 7.1.2
debug 1.9.1

Hi, I am not sure if this is a bug or I am missing anything. I have try to search around but to no avail.

Issue

I have a Rails app with a controller, I try to put binding.break in the #create action. The code stops for the very first request. However, for second request onward, the code just doesn't stop and I have to restart the server for it to stop again.

def create
  binding.break
  # some actions
end
  • First request, the code stop at the break point
CleanShot 2023-12-27 at 23 11 17@2x
  • Second request, the code doesn't stop
CleanShot 2023-12-27 at 23 12 00@2x
Dominant language
Ruby
Stars
1.3k
Forks
146
PR merge metrics
No merged PRs in 30d

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.

More from ruby/debug

All issues in ruby/debug

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.