feat: support custom timeout for DevTools license download#24722
feat: support custom timeout for DevTools license download#24722totally-not-ai[bot] wants to merge 12 commits into
Conversation
DevTools triggers an asynchronous license download that opens the system browser so the user can sign in and fetch a license. The license-checker waits a fixed 60 seconds for that to complete, which is too short for first-time users who still need to register a Vaadin account before they can download the license. When the timeout elapses the download fails and the popup that initiated it becomes stale, forcing a page reload and a repeat of the whole flow. Allow callers of downloadLicense in the dev tools to pass an optional timeout. The value is forwarded to the server and passed on to LicenseChecker.checkLicenseAsync; when omitted the previous default behavior is kept. Fixes #24717
Pass an options object to downloadLicense instead of a bare timeout argument so additional download settings can be added later without changing the method signature.
Always call the license checker with an explicit timeout, defaulting to 5 minutes when the client does not provide one, so the download behaves identically in all cases.
Exercise the url handler passed to the license checker so the browser opening logic is covered.
|
There is a timeout in LicenseChecker, which is 60 seconds. Now there is another timeout constant in DebugWindowConnection, which is 3 minutes. It is a bit odd to have two timeout constants show different values |
|
True, probably better to tune the default timeout in license checker and not include a custom one here |
Remove the server-side default timeout constant and have the dev tools client send the timeout (in seconds) with the download request. The default value now lives only in the frontend, so the server simply forwards what it receives instead of defining a second timeout value.
|
@abdullahtellioglu Good point. I removed the timeout constant from |
Only forward a timeout to the license checker when the dev tools client explicitly provides one. When omitted, the license checker's own default applies, so the default can be tuned there instead of being duplicated here.
|
@Artur- Done — removed the custom default. The dev tools now only pass a timeout to the license checker when the client explicitly provides one; when omitted, the license checker's own default applies, so it can be tuned there instead of being duplicated here. |
Note why the download uses two calls and opens the browser directly: LicenseChecker has no timeout-only checkLicenseAsync overload, so a url handler must be supplied and the checker's default handler is not accessible here.
…-download-timeout
License checker 3.1.0 adds a checkLicenseAsync overload that takes only a timeout and reuses the checker's own browser handler. Use it so the download is a single call with no browser handling here, and fall back to the checker's public default timeout when the client sends none.
…imeout' into feat/devtools-license-download-timeout
58abc4c
The previous run failed while installing flow-maven-plugin with a corrupted cached com.vaadin/maven-metadata.xml (stray content after </metadata>), unrelated to these changes. Re-running on a clean cache.
|



DevTools triggers an asynchronous license download that opens the
system browser so the user can sign in and fetch a license. The
license-checker waits a fixed 60 seconds for that to complete, which
is too short for first-time users who still need to register a Vaadin
account before they can download the license. When the timeout
elapses the download fails and the popup that initiated it becomes
stale, forcing a page reload and a repeat of the whole flow.
Allow callers of downloadLicense in the dev tools to pass an optional
timeout. The value is forwarded to the server and passed on to
LicenseChecker.checkLicenseAsync; when omitted the previous default
behavior is kept.
Fixes #24717