[Breakpoints] we should resume if we pause at an old breakpoint
With AST BPs and original BPs, it's possible that we've paused at a breakpoint before we've had a chance to move it to a new location. See GIF. In that case, we should check to see if the breakpoint is missing... or in an old location...

Missing
diff --git a/src/actions/pause.js b/src/actions/pause.js
index 4fa84b5..4462642 100644
--- a/src/actions/pause.js
+++ b/src/actions/pause.js
@@ -104,6 +104,11 @@ export function paused(pauseInfo: Pause) {
dispatch(evaluateExpressions(frame.id));
}
+ const bp = getBreakpoint(getState(), frame.location);
+ if (why.type == "breakpoint" && !bp) {
+ dispatch(resume());
+ }
+
dispatch(
selectSource(frame.location.sourceId, { line: frame.location.line })
has moved
+ const { location, astLocation } = pendingBreakpoint;
+ const previousLocation = { ...location, sourceId };
+
+ const scopedLocation = await makeScopedLocation(
+ astLocation,
+ previousLocation,
+ source
+ );
+
+ const scopedGeneratedLocation = await getGeneratedLocation(
+ getState(),
+ source,
+ scopedLocation,
+ sourceMaps
+ );
+
+ const hasMoved = locationMoved(generatedLocation, scopedGeneratedLocation);
+
+ const bp = getBreakpoint(getState(), frame.location);
+ if ((why.type == "breakpoint" && !bp) || hasMoved) {
+ dispatch(resume());
+ }
+
@jasonLaster where's the GIF mentioned in the post?

/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
I started this and got pretty close:
diff --git a/src/actions/pause/paused.js b/src/actions/pause/paused.js
index 40b7589..9763516 100644
--- a/src/actions/pause/paused.js
+++ b/src/actions/pause/paused.js
@@ -7,7 +7,8 @@
import {
getHiddenBreakpointLocation,
isEvaluatingExpression,
- getSelectedFrame
+ getSelectedFrame,
+ getBreakpointForLine
} from "../../selectors";
import { mapFrames } from ".";
import { removeBreakpoint } from "../breakpoints";
@@ -16,6 +17,7 @@ import { selectLocation } from "../sources";
import { togglePaneCollapse } from "../ui";
import { fetchScopes } from "./fetchScopes";
+import { resume } from "./commands";
import type { Pause } from "../../types";
import type { ThunkArgs } from "../types";
@@ -48,6 +50,18 @@ export function paused(pauseInfo: Pause) {
dispatch(evaluateExpressions());
}
+ const frame = frames[0];
+ if (
+ why.type == "breakpoint" &&
+ !getBreakpointForLine(
+ getState(),
+ frame.location.sourceId,
+ frame.location.line
+ )
+ ) {
+ return resume();
+ }
+
Hey @zaggy still interested?
Hey, @zaggy i'm un-assigning you as it's been a month. Feel free to-reclaim it.
This is a really cool issue that I would be happy to mentor someone on
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
/unclaim
I unclaim myself as I'm short on time currently, and don't want to block this issue for others.
Done :+1:
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
Hey @jasonLaster, I would like to work on this. Can you guide me which places to look at to better understand the flow? Thanks!
sure. ping me on slack if you want to jump on a call.
the best thing to do, i think is to find a way to fake it in the paused action and then play with it
@rohanprasad Is this something you're still looking into?
@loganfsmyth sorry, I am unable to find time to look into this issue. Unclaiming for now.
/unclaim
Done :+1: