diff --git a/services/web/app/coffee/Features/TrackChanges/TrackChangesController.coffee b/services/web/app/coffee/Features/TrackChanges/TrackChangesController.coffee index 71adadb213..d71481a7fd 100644 --- a/services/web/app/coffee/Features/TrackChanges/TrackChangesController.coffee +++ b/services/web/app/coffee/Features/TrackChanges/TrackChangesController.coffee @@ -20,6 +20,8 @@ module.exports = TrackChangesController = RangesManager.getAllChangesUsers project_id, (error, users) -> return next(error) if error? users = (UserInfoController.formatPersonalInfo(user) for user in users) + # Get rid of any anonymous/deleted user objects + users = users.filter (u) -> u?.id? res.json users acceptChange: (req, res, next) -> diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee index 20c7fb0731..279542475d 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/track-changes/TrackChangesManager.coffee @@ -93,7 +93,7 @@ define [ setTrackChanges: (value) -> if value - @$scope.sharejsDoc?.track_changes_as = window.user.id + @$scope.sharejsDoc?.track_changes_as = window.user.id or "anonymous" else @$scope.sharejsDoc?.track_changes_as = null @@ -230,10 +230,6 @@ define [ if marker.clazz.match("track-changes") console.error "Orphaned ace marker", marker - applyChange: (delta, metadata) -> - op = @_aceChangeToShareJs(delta) - @rangesTracker.applyOp(op, metadata) - updateFocus: () -> selection = @editor.getSelectionRange() cursor_offset = @_aceRangeToShareJs(selection.start) diff --git a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee index 3b9990564e..b5cc4d580c 100644 --- a/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee +++ b/services/web/public/coffee/ide/review-panel/controllers/ReviewPanelController.coffee @@ -346,8 +346,13 @@ define [ .success (users) -> _refreshingRangeUsers = false $scope.users = {} + # Always include ourself, since if we submit an op, we might need to display info + # about it locally before it has been flushed through the server + if ide.$scope.user?.id? + $scope.users[ide.$scope.user.id] = formatUser(ide.$scope.user) for user in users - $scope.users[user.id] = formatUser(user) + if user.id? + $scope.users[user.id] = formatUser(user) .error () -> _refreshingRangeUsers = false