Open Bug 1380711 Opened 7 years ago Updated 2 years ago

Investigate in showing Promise update in the Object inspector

Categories

(DevTools :: Storage Inspector, enhancement, P3)

enhancement

Tracking

(firefox57 fix-optional)

Tracking Status
firefox57 --- fix-optional

People

(Reporter: Oriol, Unassigned)

References

Details

1. Open the new console frontend
2. Enter new Promise(f => setTimeout(f, 0))
3. The preview shows Promise { <state>: "pending" } because the promise didn't resolve immediately
4. Expand the promise

Result: it still says <state> : "pending", but now the promise has been resolved.

This didn't happen with variablesview, e.g.

 > var p = new Promise(f => setTimeout(f, 0)); p;
   Promise { <state>: "pending" }
 > inspect(p);
Whiteboard: [console-html] [triage]
Flags: qe-verify?
Priority: -- → P3
Whiteboard: [console-html] [triage] → [reserve-console-html]
I am not sure if this should be considered as a bug here.
If we wanted to be more fair, we should compare 

```new Promise(f => setTimeout(f, 0))```

with

```inspect(new Promise(f => setTimeout(f, 0)))```

or 

```
> p = new Promise(f => setTimeout(f, 0));
> p;
```

with

```
> p = new Promise(f => setTimeout(f, 0));
> inspect(p);
```

Because in the latter case, you give time to the Promise to be resolved.
If we compare apples to apples, the Object Inspector and the VariableView behaves the same way.
Which I think is the correct way since logging show you the value of an object at the specific time you logged it.

What we could think about though, is having a way to tell the user that an object was updated and add a reload/refresh button on it so the user can see the new value.
I am not sure if this is useful for all objects, but promise might be a good candidate for this.

I am a bit concerned too of the performance cost that this would introduce if we start watching for every update on every logged object.
Summary: Object inspector does not retrieve new Promise state → Investigate in showing Promise update in the Object inspector
Flags: qe-verify?
Priority: P3 → --
Whiteboard: [reserve-console-html]
Priority: -- → P3
Severity: normal → enhancement
See Also: → 1445887
Product: Firefox → DevTools

Moving to the DOM panel as it's VariableView related and only the DOM panel uses the VariableView now

Component: Object Inspector → DOM

erratum: this should have been moved to the storage inspector, which is the last consumer of the variable view

Component: DOM → Storage Inspector
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.