New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 631459 link

Starred by 4 users

Issue metadata

Status: Archived
Owner:
Last visit 29 days ago
Closed: Dec 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Snippets can be lost when manipulating snippets in more than one instance concurrently

Project Member Reported by phistuck@gmail.com, Jul 26 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36

Steps to reproduce the problem:
1. Go to tab 1.
2. Open the Developer Tools.
3. Go to tab 2.
4. Open the Developer Tools.
5. Add a snippet in tab 1.
6. Change an existing snippet in tab 2.
7. Close both of the Developer Tools instances.
8. Open the Developer Tools.

What is the expected behavior?
The added snippet is there.

What went wrong?
The added snippet is lost.

Did this work before? No 

Chrome version: 51.0.2704.106  Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 22.0 r0

Snippets should at least be synchronized within a user profile.
Note - issue 249030 talks about synchronizing them using Chrome Sync, which is nice to have, but you are not losing snippets because of it.
 
Components: -Platform>DevTools Platform>DevTools>Editing Platform>DevTools>UX
I can reproduce the issue.

We can solve this by re-fetching the current saved snippets before updating the saved data. We can then find a way to incorporate the local changes into the existing saved data.

I'll have a look at writing a fix for this.
It looks like all settings are loaded once when opening DevTools and then never loaded again.

I could change it to reload the settings before saving a snippet, but I'm wondering if there's a particular reason not to do that. I think it would also make sense to add a  function to load only one specific setting rather than all settings at once.

So I'm holding off on implementing anything for now and will wait to hear more thoughts on this.
Labels: -Pri-2 Pri-3
Owner: lushnikov@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 5 by phistuck@gmail.com, Jul 27 2016

@dgozman or @lushnikov -
Can you, please, advise #3 regarding a reasonable course of action?
I'd try to teach WI.Setting to fire Change event in case of respective "storage" event from window. Important thing is that probably not every client want to react to this events, so it should be opt-in. 
I've got it all working nicely on my local server.

However, in the integrated DevTools the snippets aren't actually stored in localStorage, they are stored as a preference in the "backend". So listening to the "storage" event won't work.

There doesn't seem to be a way to listen to preference changes that occur in the backend. I could refetch the whole preferences with `InspectorFrontendHost.getPreferences` and then incorporate the changes. If that's an acceptable solution I can go ahead with this.

Otherwise I think it would be better for someone else to look into this.
Indeed, there events from pref changing are not implemented yet. However, it should not be hard to do, using pref notifier (https://cs.chromium.org/chromium/src/components/prefs/pref_notifier_impl.h?cl=GROK&gsn=GetPrefs&rcl=1470367490&l=33)

Thanks for the pointers. I've had a look, but I don't feel confident implementing this right now.
Components: Platform>DevTools>Authoring
Components: Platform>DevTools
Status: Archived (was: Assigned)
There are no plans to work on this in the upcoming year. If you think this is important, please re-file with justification.

Thanks.

Sign in to add a comment