Closed Bug 1689275 Opened 3 years ago Closed 3 years ago

Avoid notifying empty events to listener.

Categories

(Toolkit :: Places, defect)

defect
Points:
2

Tracking

()

RESOLVED FIXED
87 Branch
Iteration:
87.1 - Jan 25 - Feb 7
Tracking Status
firefox87 --- fixed

People

(Reporter: daisuke, Assigned: daisuke)

References

Details

Attachments

(1 file)

If we call PlacesObserver.notifyListeners with empty events.
any registering listeners received the empty events.

See the following code.

PlacesObservers.addListener("page-visit", events => {
  console.log(events.length);
});
PlacesObservers.notifyListeners([]);

When run the code, we can see 0 in console.

I think we'd better avoid notifying the empty events to listeners.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: