Skip to content

Conversation

sissbruecker
Copy link
Contributor

Cherry-pick of #7616

* @return The generated temp file handle with the provided extension
* @throws IOException
*/
File createTempFile(String extension) throws IOException {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an overload to allow passing a file extension

Comment on lines 134 to 139
private void waitForUploads(int maxSeconds) {
Timeouts timeouts = getDriver().manage().timeouts();
timeouts.scriptTimeout(Duration.of(15, ChronoUnit.SECONDS));

String script = "var callback = arguments[arguments.length - 1];"
+ "var upload = arguments[0];"
+ "window.setTimeout(function() {"
+ " var inProgress = upload.files.filter(function(file) { return file.uploading;}).length >0;"
+ " if (!inProgress) callback();" //
+ "}, 500);";
getCommandExecutor().getDriver().executeAsyncScript(script, this);
String script = "return arguments[0].files.every((file) => !file.uploading);";

waitUntil(driver -> (Boolean) executeScript(script, UploadElement.this),
maxSeconds);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't working reliably, replaced it with the logic we have in newer versions

@sissbruecker sissbruecker requested a review from mcollovati June 18, 2025 14:16
Copy link

@sissbruecker sissbruecker merged commit 44c8f07 into 23.6 Jun 18, 2025
5 checks passed
@sissbruecker sissbruecker deleted the fix/interrupt-all-uploads-23.6 branch June 18, 2025 14:40
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 23.6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants