Closed Bug 1575065 Opened 5 years ago Closed 1 month ago

Breakpoints should work when reloading

Categories

(Core Graveyard :: Web Replay, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: jlast, Unassigned)

References

Details

STR:

  1. go to https://firefox-dev.tools/debugger-examples/examples/todomvc/
  2. add a breakpoint in todo-view.js#35 in initialize
  3. add some todos
  4. reload

ER: pause on line 35
AR: don't pause

NOTE: that adding a new bp will pause, it is just the initial hits which are missed. This is similar for log points

A similar STR is for logpoints

STR:

  1. go to https://firefox-dev.tools/debugger-examples/examples/todomvc/
  2. add a logpoint in todo-view.js#53 in render
  3. add some todos
  4. reload

ER: see the render logpoints
AR: logpoints do not appear

Priority: P3 → P1

The last STR stated that you do not see logpoints after reloading. Now you do, but you cannot remove them...

STR:

  1. go to https://firefox-dev.tools/debugger-examples/examples/todomvc/
  2. add a logpoint in todo-view.js#53 in render
  3. add some todos
  4. reload

ER: see the log points and can remove them.

https://www.loom.com/share/7ff615d38dec477c99e222df05eb0dc3

This fixes the issue with removing log points, but now you can't add them back.

diff --git a/devtools/client/debugger/src/client/firefox/commands.js b/devtools/client/debugger/src/client/firefox/commands.js
index cb9d6c388b9b..26a7c6d5bc8d 100644
--- a/devtools/client/debugger/src/client/firefox/commands.js
+++ b/devtools/client/debugger/src/client/firefox/commands.js
@@ -222,13 +222,13 @@ function detachWorkers() {
   }
 }

-function maybeGenerateLogGroupId(options) {
+function maybeGenerateLogGroupId(options, key) {
   if (
     options.logValue &&
     currentTarget.traits &&
     currentTarget.traits.canRewind
   ) {
-    return { ...options, logGroupId: `logGroup-${Math.random()}` };
+    return { ...options, logGroupId: `logGroup-${key}` };
   }
   return options;
 }
@@ -251,9 +251,10 @@ function setBreakpoint(
   location: BreakpointLocation,
   options: BreakpointOptions
 ) {
+  const key = locationKey(location);
   maybeClearLogpoint(location);
-  options = maybeGenerateLogGroupId(options);
-  breakpoints[locationKey(location)] = { location, options };
+  options = maybeGenerateLogGroupId(options, key);
+  breakpoints[key] = { location, options };

   return forEachThread(thread => thread.setBreakpoint(location, options));
 }
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.