GoogleChrome / samples

A repo containing samples tied to new functionality in each release of Google Chrome.
https://www.chromestatus.com/samples
Apache License 2.0
5.79k stars 2.38k forks source link

Presentation API raise crash Chrome with Chrome version 105 #778

Open binhhuynhgit opened 2 years ago

binhhuynhgit commented 2 years ago

Hi @mfoltzgoogle,

I've using Presentation API with Chrome Cast. It still stable with previous version untill Chrome upgrade to new version 105, i've problem Chrome crashed when casting a device (previous version 104 work fine) At Chrome 105 version, it's work fine when you already Cast to a device for first times (click button presentationRequest.start()) but second times click button presentationRequest.start() then Chrome will be crashed.

Pls help me share that's bug isn't it?

beaufortfrancois commented 2 years ago

I cannot reproduce with https://googlechrome.github.io/samples/presentation-api/ sadly.

@binhhuynhgit Do you mind filing an issue at https://crbug.com/new with steps to reproduce so that the chrome team can look at it?

binhhuynhgit commented 2 years ago

Hi @beaufortfrancois, I describe detail step to reproduce, pls try again:

Step 1: Navigate to link https://googlechrome.github.io/samples/presentation-api/ on Chrome browser.

Step 2: Click button presentationRequest.start(). On the appearing popup, choose Cast to device.

Step 3: Duplicate tab chrome (at Step 1). And now, we've two step with adress https://googlechrome.github.io/samples/presentation-api/.

Step 4: At new tab (dupplicate from Step 3), continue click button presentationRequest.start(). On the appearing popup, choose Cast to device => at this step Chrome will be crashed (just Chrome 105 version, I've try on Chrome 104 version it's worked)

Thanks @beaufortfrancois.

beaufortfrancois commented 2 years ago

I can't reproduce in Chrome Canary 107.0.5282.0. How about you? https://chrome.com/canary

binhhuynhgit commented 2 years ago

I had check with Chrome Canary Version 107.0.5284.0 (Official Build) canary (64-bit) => It's worked.

But with more than 1000 of my users, they're using Google Chrome Version 105.0.5195.102 (Official Build) (64-bit). I don't know this issue is limited from Chrome version 105 or Presentation API's fault .

beaufortfrancois commented 2 years ago

Thank you!

Can you try with Chrome Beta (https://chrome.com/beta) and Chrome Dev (https://chrome.com/dev) to isolate the issue?

binhhuynhgit commented 2 years ago

Hi @beaufortfrancois

with Chrome Beta Version 106.0.5249.21 (Official Build) beta (64-bit) => it also crashes Chrome browser. with Chrome Dev Version 106.0.5249.21 (Official Build) dev (64-bit) => it also crashes Chrome browser.

beaufortfrancois commented 2 years ago

That is helpful. Thank you @binhhuynhgit Let me see what I can find.

beaufortfrancois commented 2 years ago

I've filed https://bugs.chromium.org/p/chromium/issues/detail?id=1360379 and cc'ed @mfoltzgoogle. Which platform do you use (Windows, macOS, Linux, Android, ...)?

binhhuynhgit commented 2 years ago

I'm using Windows.

binhhuynhgit commented 2 years ago

Thanks @beaufortfrancois. I'm checking id bug [1360379] but got "Permission denied." so I can not follow this issue.

And today, with Chrome version 105 I got the other issue "DOMException: Failed to execute 'start' on 'PresentationRequest': PresentationRequest::start() requires user gesture"

beaufortfrancois commented 2 years ago

Thanks @beaufortfrancois. I'm checking id bug [1360379] but got "Permission denied." so I can not follow this issue.

The chrome team restricted view access while they're investigating the root issue. I'll let you know how it goes.

And today, with Chrome version 105 I got the other issue "DOMException: Failed to execute 'start' on 'PresentationRequest': PresentationRequest::start() requires user gesture"

Can you share your code? I can't reproduce with https://googlechrome.github.io/samples/presentation-api/ in Chrome 105.0.5195.102 on macOS.

markafoltz commented 2 years ago

@binhhuynhgit It's restricted so we can examine crash reports, but if you are OK sending me your email address I can CC you so you can get updates.

binhhuynhgit commented 2 years ago

@binhhuynhgit It's restricted so we can examine crash reports, but if you are OK sending me your email address I can CC you so you can get updates.

My email adress: htbinh230989@gmail.com. Thanks @mfoltzgoogle.

binhhuynhgit commented 2 years ago

Hi @mfoltzgoogle, @beaufortfrancois

On Chrome version 104.0.5112.102 I also got an error about DOMException: Failed to execute 'start' on 'PresentationRequest': PresentationRequest::start() requires user gesture I'll describe my issue + share my coding as image below:

beaufortfrancois commented 2 years ago

Thanks for the screenshot. It helps a lot. When user clicks button, you're actually doing a POST request and only then, call PresentationRequest::start() which raises the error because the user gesture is "lost". It can happen if the POST request takes too much time. I'd suggest you do the HTTP request before user clicks the button OR call PresentationRequest::start() directly when user clicks button and call stop() if POST request is unsuccessful.

binhhuynhgit commented 2 years ago

Thanks for the screenshot. It helps a lot. When user clicks button, you're actually doing a POST request and only then, call PresentationRequest::start() which raises the error because the user gesture is "lost". It can happen if the POST request takes too much time. I'd suggest you do the HTTP request before user clicks the button OR call PresentationRequest::start() directly when user clicks button and call stop() if POST request is unsuccessful.

At this time, I still keep old coding (as shared previous) => it's working good. It's show popup look like picture below. I feel confused with error occur sometimes but I don't know exactly root cause (I guess PresentationRequest is cached lead to user gesture is "lost", right @mfoltzgoogle? Do you think so?) I've more question user gesture is "lost" it's means the popup (like picture below) lost, right?

image

Waazer commented 2 years ago

Hi @mfoltzgoogle,

I've using Presentation API with Chrome Cast. It still stable with previous version untill Chrome upgrade to new version 105, i've problem Chrome crashed when casting a device (previous version 104 work fine) At Chrome 105 version, it's work fine when you already Cast to a device for first times (click button presentationRequest.start()) but second times click button presentationRequest.start() then Chrome will be crashed.

Pls help me share that's bug isn't it?