Bug 280681

Summary: [GTK] WebKitWebProcess not reused nor freed after "timeout"
Product: WebKit Reporter: Milan Crha <mcrha>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, mcatanzaro, yaneti
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
wk2.c (reproducer) none

Description Milan Crha 2024-10-01 07:23:40 PDT
Created attachment 472750 [details]
wk2.c (reproducer)

Follow up from bug #279914, still with webkit2gtk4.1-2.46.0-3.fc42.x86_64

Steps:
1) get the reproducer from the attachment, just compile & run it (see the first line of the file)
2) whenever you click the "Reload" button there are added new WebKitWebProcess-es, even though the URL-s being opened in the web view are the same.

The Reload first loads "evo-file://...." URL, then "mail://..." URL, in both cases the same URL-s no change in them, thus the re-use might be possible, but that does not happen, new WebProcess-es are created regardless.

(My) Theory: reuse works for http://, https://, maybe file://, but when there are used custom schemes it misbehaves.

The second problem: the bug #279914 mentions the unused processes might get vanished after some time (can be 5 minutes or 30 minutes), but they stay there even after two hours of the application being idle, user not interacting with it.
Comment 1 Michael Catanzaro 2024-10-01 07:45:38 PDT
This will be a blocker for porting Evolution to GTK 4 since PSON is mandatory there.
Comment 2 Milan Crha 2024-10-01 08:04:17 PDT
> This will be a blocker for porting Evolution to GTK 4 since PSON is mandatory there.

I'm not sure of it. The web view changes the origin, but it's not like the mail:// contains other than mail:// iframes. The other resources are handled by the Evolution itself, the WebView/WebPage does not have access to the Internet (virtually speaking, because WebKit does not ask for each and ever URL, like the preload DNS and some others).

Anyway, gtk4 for evo is too far away, do not make it stop you from fixing current bugs.