Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Update createRequest warning message to indicate a possible solution #5101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

terencehonles
Copy link
Contributor

@terencehonles terencehonles commented Oct 5, 2021

This change updates the createRequest signal on a disposed NetworkAccessManager warning message to indicate one more issue that may be fixed by a user controlled setting. This was discovered by running with --log-level debug which I added in b8f9f5e / #4668 and seeing the debug message "Loading done; Stopping QWebPage and any possible page refreshes." before I expected it to be called (before an API request had
finished). This is called by the loadFinished handler

// XXX: If loading failed there's no need to wait
// for javascript on this resource.
if (!ok || signalPrint || settings.jsdelay == 0) loadDone();
else if (isMain && !settings.windowStatus.isEmpty()) waitWindowStatus();
else QTimer::singleShot(settings.jsdelay, this, SLOT(loadDone()));
and from that I realized that loadDone was being called too early. I don't believe the immediate loadDone() is being called because the default JavaScript delay is 200ms, but setting the timeout to a larger value fixed the issue for me, and logging this suggestion as a warning may help someone else when debugging.

@terencehonles terencehonles force-pushed the add-suggestion-in-warning-message branch from 861aea7 to 4f507a4 Compare October 5, 2021 19:27
This change updates the `createRequest` signal on a `disposed`
`NetworkAccessManager` warning message to indicate one more issue that
may be fixed by a user controlled setting. This was discovered by
running with `--log-level debug` which I added in b8f9f5e /
wkhtmltopdf#4668 and seeing the
debug message "Loading done; Stopping QWebPage and any possible page
refreshes." before I expected it to be called (before an API request had
finished). This is called by the `loadFinished` handler
https://github.com/wkhtmltopdf/wkhtmltopdf/blob/5b26acc41d8209d3b4c4018ac7350b8cea64fa73/src/lib/multipageloader.cc#L336-L340
and from that I realized that `loadDone` was being called too early. I
don't believe the immediate `loadDone()` is being called because the
default JavaScript delay is 200ms, but setting the timeout to 5 seconds
fixed the issue for me, and logging this suggestion as a warning may
help someone else when debugging.
@terencehonles terencehonles force-pushed the add-suggestion-in-warning-message branch from 4f507a4 to d5d4a31 Compare July 5, 2022 21:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant