Bug 220073 - Stop speech recognition if page becomes invisible
Summary: Stop speech recognition if page becomes invisible
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-12-21 15:09 PST by Sihui Liu
Modified: 2021-01-07 11:22 PST (History)
2 users (show)

See Also:


Attachments
Patch (14.48 KB, patch)
2020-12-21 15:23 PST, Sihui Liu
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (14.54 KB, patch)
2020-12-21 15:49 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (9.52 KB, patch)
2021-01-05 11:50 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (11.64 KB, patch)
2021-01-05 16:20 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (11.61 KB, patch)
2021-01-06 09:17 PST, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (11.60 KB, patch)
2021-01-06 09:22 PST, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sihui Liu 2020-12-21 15:09:18 PST
...
Comment 1 Sihui Liu 2020-12-21 15:23:05 PST
Created attachment 416637 [details]
Patch
Comment 2 Sihui Liu 2020-12-21 15:49:13 PST
Created attachment 416640 [details]
Patch
Comment 3 Radar WebKit Bug Importer 2020-12-28 15:10:20 PST
<rdar://problem/72710704>
Comment 4 youenn fablet 2021-01-04 01:58:02 PST
iOS failure might be due to https://bugs.webkit.org/show_bug.cgi?id=175204.
I guess we should disable it for now but make sure this is working as expected through manual test.
Comment 5 youenn fablet 2021-01-04 01:58:54 PST
Comment on attachment 416640 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=416640&action=review

> Source/WebKit/UIProcess/SpeechRecognitionServer.cpp:177
> +    auto error = WebCore::SpeechRecognitionError { WebCore::SpeechRecognitionErrorType::Aborted, "Page became invisible"_s };

s/Page became invisible/Page is no longer visible/
Comment 6 Sihui Liu 2021-01-05 11:50:31 PST
Created attachment 417024 [details]
Patch for landing
Comment 7 Sihui Liu 2021-01-05 11:54:35 PST
(In reply to youenn fablet from comment #4)
> iOS failure might be due to https://bugs.webkit.org/show_bug.cgi?id=175204.
> I guess we should disable it for now but make sure this is working as
> expected through manual test.

Manually tested with Safari; recognition will abort when tab becomes invisible.
Comment 8 EWS 2021-01-05 12:25:16 PST
Committed r271169: <https://trac.webkit.org/changeset/271169>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417024 [details].
Comment 9 Ryan Haddad 2021-01-05 14:10:21 PST
This caused SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage to time out on macOS. EWS caught it, but after the patch had landed.

https://bugs.webkit.org/show_bug.cgi?id=220337
Comment 10 Ryan Haddad 2021-01-05 14:30:59 PST
Reverted r271169 for reason:

Caused TestWebKitAPI.WebKit2.SpeechRecognitionErrorWhenStartingAudioCaptureOnDifferentPage to time out on macOS.

Committed r271174: <https://trac.webkit.org/changeset/271174>
Comment 11 Ryan Haddad 2021-01-05 15:45:11 PST
Also of note: TestWebKitAPI.WebKit2.SpeechRecognitionPageBecomesInvisible, added with this patch, was asserting on Mojave bots

        ASSERTION FAILED: !m_requests.contains(clientIdentifier)
        /Volumes/Data/slave/mojave-debug/build/Source/WebKit/UIProcess/SpeechRecognitionServer.cpp(58) : void WebKit::SpeechRecognitionServer::start(WebCore::SpeechRecognitionConnectionClientIdentifier, WTF::String &&, bool, bool, uint64_t, WebCore::ClientOrigin &&)


https://build.webkit.org/builders/Apple-Mojave-Debug-WK2-Tests/builds/13661/steps/run-api-tests/logs/stdio
Comment 12 Sihui Liu 2021-01-05 16:20:21 PST
Created attachment 417049 [details]
Patch
Comment 13 Sihui Liu 2021-01-06 09:17:45 PST
Created attachment 417089 [details]
Patch for landing
Comment 14 EWS 2021-01-06 09:18:41 PST
Downloading keyring-7.3.1...
Installing keyring-7.3.1...
Installed keyring-7.3.1!
Downloading configparser-4.0.2...
Installing configparser-4.0.2...
Installed configparser-4.0.2!
Downloading mechanize-0.4.5...
Installing mechanize-0.4.5...
Installed mechanize-0.4.5!
ChangeLog entry in Source/WebKit/ChangeLog contains OOPS!.
Comment 15 Sihui Liu 2021-01-06 09:22:47 PST
Created attachment 417093 [details]
Patch for landing
Comment 16 EWS 2021-01-06 11:22:29 PST
Committed r271205: <https://trac.webkit.org/changeset/271205>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417093 [details].