Skip to content

[Console][QuestionHelper] add optional timeout for human interaction #61092

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

Open
wants to merge 8 commits into
base: 7.4
Choose a base branch
from

Conversation

janedbal
Copy link
Contributor

@janedbal janedbal commented Jul 10, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues None
License MIT

About:

  • Adds timeout functionality to console questions, allowing developers to set a maximum time limit for user input.
  • Our usecase is that some developers added interactive questions inside opened db transactions. Without timeout, it can lead to hours long trx if somebody forgets to repond and keeps the terminal open.
  • The feature is backward compatible - existing code continues to work without timeouts unless explicitly set.

@janedbal janedbal requested a review from chalasr as a code owner July 10, 2025 11:16
@carsonbot carsonbot added this to the 7.4 milestone Jul 10, 2025
@carsonbot carsonbot changed the title QuestionHelper: add optional timeout for human interaction [Console] QuestionHelper: add optional timeout for human interaction Jul 10, 2025
@OskarStark OskarStark changed the title [Console] QuestionHelper: add optional timeout for human interaction [Console][QuestionHelper] add optional timeout for human interaction Jul 10, 2025
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
@@ -38,6 +38,7 @@ class Question
private ?\Closure $normalizer = null;
private bool $trimmable = true;
private bool $multiline = false;
private ?int $timoutSeconds = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private ?int $timoutSeconds = null;
private ?int $timeoutSeconds = null;

@@ -10,6 +10,7 @@ CHANGELOG
* Add `BackedEnum` support with `#[Argument]` and `#[Option]` inputs in invokable commands
* Allow Usages to be specified via `#[AsCommand]` attribute.
* Allow passing invokable commands to `Symfony\Component\Console\Tester\CommandTester`
* add optional timeout for human in `QuestionHelper`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* add optional timeout for human in `QuestionHelper`
* Add optional timeout for interaction in `QuestionHelper`

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.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy