bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Investigate in showing Promise update in the Object inspector

NEW
Unassigned

Status

DevTools
Object Inspector
P3
enhancement
a year ago
a month ago

People

(Reporter: Oriol, Unassigned)

Tracking

unspecified

Firefox Tracking Flags

(firefox57 fix-optional)

Details

(Reporter)

Description

a year ago
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]
status-firefox57: --- → fix-optional
Priority: -- → P3

Updated

8 months ago
Severity: normal → enhancement
(Reporter)

Updated

2 months ago
See Also: → bug 1445887

Updated

a month ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.