Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit 3550675

Browse files
author
Matt Loring
committed
Only mark breakpoints done when api call succeeds
The first part of the TODO is deemed no longer necessary because we already have our request handle retriest for transient errors.
1 parent 0d9a312 commit 3550675

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/debuglet.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,19 +339,16 @@ Debuglet.prototype.completeBreakpoint_ = function(breakpoint) {
339339
var that = this;
340340

341341
that.logger_.info('\tupdating breakpoint data on server', breakpoint.id);
342-
// TODO: in case of transient errors, retry the update operation
343-
// Put in the completed breakpoints map only when the update successfully
344-
// completes. Otherwise - we refuse to set the breakpoint, but the server
345-
// has never seen the update.
346342
that.debugletApi_.updateBreakpoint(breakpoint, function(err/*, body*/) {
347343
if (err) {
348344
that.logger_.error('Unable to complete breakpoint on server', err);
345+
} else {
346+
// TODO(ofrobots): breakpoint may be holding on to a lot of data. We only
347+
// need to remember the breakpoint id.
348+
that.completedBreakpointMap_[breakpoint.id] = breakpoint;
349+
that.removeBreakpoint_(breakpoint);
349350
}
350351
});
351-
// TODO(ofrobots): breakpoint may be holding on to a lot of data. We only
352-
// need to remember the breakpoint id.
353-
that.completedBreakpointMap_[breakpoint.id] = breakpoint;
354-
that.removeBreakpoint_(breakpoint);
355352
};
356353

357354

0 commit comments

Comments
 (0)