Closed Bug 1539506 Opened 5 years ago Closed 5 years ago

Ensure reducer breakpoints and installed breakpoints are in sync

Categories

(DevTools :: Debugger, enhancement, P2)

enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The aysnchronous operations done when setting or removing a breakpoint can lead to cases where breakpoints are installed in the server but not shown in the UI, or where breakpoints are shown in the UI but not installed in the server.

For example, when doing an addBreakpoint() we update the reducer store with the breakpoint (albeit a deformed one which is shown in the editor but not the breakpoints pane), await on the breakpoint being set in the server, and then update the reducer (again) with the complete breakpoint. It is possible that, at the time after the breakpoint is set in the server but before addBreakpoint completes, a removeBreakpoint could remove the breakpoint entirely from the server and UIT, and the final addBreakpoint action would then update the reducer with a breakpoint that is not actually installed in the server.

To fix this, we need to ensure that updates to the reducer happen atomically wrt client operations that change the installed breakpoints in the server, i.e. there are no awaits between one and the other. There is a time interval here where the reducer has been updated but the breakpoint operation has not finished in the server, but given enough time the two will get back in sync. Optimistically updating the UI in this way seems like the right thing to do, to make sure it responds immediately to user input.

Priority: -- → P2
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdc95cb69849
Ensure reducer breakpoints and installed breakpoints are in sync, r=loganfsmyth.

Backed out changeset bdc95cb69849 (Bug 1539506) for debugger FAIL src/actions/sources/tests/loadSource.spec.js

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=bdc95cb6984914763304589aebd718c8da260351

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=237229879&repo=mozilla-inbound

Backout link: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&resultStatus=testfailed%2Cbusted%2Cexception&classifiedState=unclassified&revision=9230d220a142d00607ada91fa87d2af68c1aaa39

[task 2019-03-31T19:01:10.225Z] Summary of all failing tests
[task 2019-03-31T19:01:10.230Z] FAIL src/actions/sources/tests/loadSource.spec.js
[task 2019-03-31T19:01:10.235Z] ● loadSourceText › should update breakpoint text when a source loads
[task 2019-03-31T19:01:10.235Z]
[task 2019-03-31T19:01:10.239Z] expect(received).toBe(expected) // Object.is equality
[task 2019-03-31T19:01:10.239Z]
[task 2019-03-31T19:01:10.240Z] Expected: ""
[task 2019-03-31T19:01:10.244Z] Received: "var fooGen = 42;"
[task 2019-03-31T19:01:10.244Z]
[task 2019-03-31T19:01:10.245Z] 90 | }
[task 2019-03-31T19:01:10.245Z] 91 |
[task 2019-03-31T19:01:10.250Z] > 92 | expect(breakpoint.text).toBe("");
[task 2019-03-31T19:01:10.253Z] | ^
[task 2019-03-31T19:01:10.255Z] 93 | expect(breakpoint.originalText).toBe("");
[task 2019-03-31T19:01:10.255Z] 94 |
[task 2019-03-31T19:01:10.257Z] 95 | await dispatch(actions.loadSourceText(fooOrigSource));
[task 2019-03-31T19:01:10.257Z]
[task 2019-03-31T19:01:10.260Z] at Object.<anonymous> (src/actions/sources/tests/loadSource.spec.js:92:29)
[task 2019-03-31T19:01:10.262Z] at step (src/actions/sources/tests/loadSource.spec.js:9:191)
[task 2019-03-31T19:01:10.264Z] at src/actions/sources/tests/loadSource.spec.js:9:361
[task 2019-03-31T19:01:10.264Z]
[task 2019-03-31T19:01:10.264Z]
[task 2019-03-31T19:01:10.265Z] Test Suites: 1 failed, 200 passed, 201 total
[task 2019-03-31T19:01:10.265Z] Tests: 1 failed, 10 skipped, 1676 passed, 1687 total
[task 2019-03-31T19:01:10.265Z] Snapshots: 437 passed, 437 total
[task 2019-03-31T19:01:10.265Z] Time: 203.753s
[task 2019-03-31T19:01:10.265Z] Ran all test suites in 5 projects.
[task 2019-03-31T19:01:10.324Z] error Command failed with exit code 1.
[task 2019-03-31T19:01:10.324Z] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[taskcluster 2019-03-31 19:01:10.652Z] === Task Finished ===
[taskcluster 2019-03-31 19:01:10.652Z] Unsuccessful task run with exit code: 1 completed in 553.71 seconds

Flags: needinfo?(bhackett1024)
Pushed by bhackett@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e60364383e3
Ensure reducer breakpoints and installed breakpoints are in sync, r=loganfsmyth.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Depends on: 1540848
Flags: needinfo?(bhackett1024)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: