New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REGRESSION(r294381): [ Debug ] TestWebKitAPI.WebKit.CookieObserverCrash is a constant crash #816
REGRESSION(r294381): [ Debug ] TestWebKitAPI.WebKit.CookieObserverCrash is a constant crash #816
Conversation
@@ -49,7 +49,8 @@ WebCookieManagerProxy::~WebCookieManagerProxy() | |||
{ | |||
if (m_networkProcess) | |||
m_networkProcess->removeMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName()); | |||
ASSERT(m_cookieObservers.isEmpty()); | |||
if (!m_cookieObservers.isEmpty()) | |||
RELEASE_LOG(Storage, "WebCookieManagerProxy::~WebCookieManagerProxy %u cookie observers will be invalidated", m_cookieObservers.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this mean that the API client may still have a registered cookie observer and yet no longer receive any notifications because the WebCookieManagerProxy was destroyed? Wouldn't this be a bug?
Seems like if the clients is monitoring cookies, they should be getting updates until they unregister their observer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just like the failed test. If client has a registered cookie observer but WebsiteDataStore is destroyed, the observer will not get any notification. It looks reasonable to me that client does not get notification about cookies of an ephemeral session if the session is destroyed? (The ref chains are: WKWebsiteDataStore => WebsiteDataStore => NetworkProcessProxy => WebCookieManagerProxy and WKHttpCookieStore => API::HTTPCookieStore -> WebCookieManagerProxy).
I am not sure how this API is supposed to work originally, at least according to current implementation, the assertion seems to not hold.
I'll defer Brady/Alex here. This seems like suspicious API behavior to me and a regression from your recent refactoring since the assertion wasn't hitting before. Fixing the assertion hit by removing the assertion is always suspicious too. |
The assertion wasn't hit because WebsiteDataStore was held alive by WebProcessProxy, so WebsiteDataStore is not destroyed as expected during the test. |
@beidson Added this test here: He intentionally made sure that the APIHTTPCookieStore would keep its data store alive. |
Yes, as mentioned in the commit message: this statement that APIHTTPCookieStore would keep its data store alive is no longer valid after https://trac.webkit.org/changeset/279074/webkit (from @achristensen07, reviewed by @cdumez ). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. We should really just completely remove WebCookieManagerProxy.
4a888b0
to
3ba1f41
Compare
Committed r294860 (250992@main): https://commits.webkit.org/250992@main Reviewed commits have been landed. Closing PR #816 and removing active labels. |
3ba1f41