Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1253)

Issue 968533003: Discard previous overlay content on _sourceChanged() notification. (Closed)

Created:
5 years, 9 months ago by scheglov
Modified:
5 years, 9 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Discard previous overlay content on _sourceChanged() notification. This fixes the following scenario: 1. Edit a file. Server adds overlay. 2. Save a file. Editor save the file buffer to disk. Editor asks to remove the overlay. Server remove the overlay. Engine checks that the previous overlay content is the same as the file content and remembers this content in the LRU cache. 3. Server receives a file system modification event. Engine starts processing the change and ignores it in _sourceChanged() because the previous overlay content is the save. But it keeps this content in the cache! 4. User switches to another branche, so the file is change. Server receives a file system modification event. Engine sees that the content of the file is not the same as the content in the previous overlay and performs full analysis. 5. User switches back to the original branch. Server receives a file system modification event. Engine in _sourceChanged() ignore the change, because it is the same as it was before! So, we need to clear the previous overlay cache once we use it. Therefore we can just put it into the SourceEntry itself. This also simplifies the cache management - we don't need another way to remove elements on change, or a file removal. The only situation when we might keep content longer than required is in the following scenario: 1. User makes a change, adds an overlay. 2. User makes a change that restores initial content. 3. Editor asks the server to remove the overlay. Practially however Editor keep the file dirty in this case. So, user will save the file eventully and we will remove the cached previous content from the entry. R=brianwilkerson@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=44116

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -9 lines) Patch
M pkg/analyzer/lib/src/generated/engine.dart View 4 chunks +3 lines, -9 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
scheglov
5 years, 9 months ago (2015-02-28 06:26:32 UTC) #1
Brian Wilkerson
LGTM
5 years, 9 months ago (2015-02-28 15:42:18 UTC) #2
scheglov
5 years, 9 months ago (2015-03-01 18:47:33 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as 44116 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698