Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Add--class-filter option to themessenger:failed:remove command#59978

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

arnaud-deabreu
Copy link
Contributor

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

This PR adds the--class-filter to themessenger:failed:remove command which is already available onmessenger:failed:show command.
It will yield the message ids that match the given class and use it as if it were passed as theid argument in the command so the--force and--show-messages can work with this filter.
When using the filter, the command will prompt for confirmation before removing the messages.

Example output:

$ bin/console messenger:failed:remove --class-filter="App\Message\MyMessage" There is 16 messages to remove. Do you want to continue? (yes/no) [yes]:

valtzu, 94noni, and Valmonzo reacted with thumbs up emoji
@carsonbotcarsonbot added this to the7.3 milestoneMar 14, 2025
@arnaud-deabreuarnaud-deabreuforce-pushed thefeature/messenger-delete-failed-message-by-class-filter branch from15bd310 to8557685CompareMarch 15, 2025 07:44
Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@OskarStark
Copy link
Contributor

class-filter sounds to much technical to me. What about message-filter ?

@chalasr
Copy link
Member

chalasr commentedMar 24, 2025
edited
Loading

@OskarStarkmessage-filter seems too broad to me. Alsoclass-filter is inline with what exists inFailedMessagesShowCommand

arnaud-deabreu, mtarld, and OskarStark reacted with thumbs up emoji

@arnaud-deabreuarnaud-deabreuforce-pushed thefeature/messenger-delete-failed-message-by-class-filter branch frombe6573e tofae8ce5CompareMarch 24, 2025 07:27
throw new RuntimeException('No failed messages were found with this filter.');
}

if (!$io->confirm(\sprintf('There is %d message%s to remove. Do you want to continue?', $idsCount, $idsCount > 1 ? 's' : ''))) {
Copy link
Member

Choose a reason for hiding this comment

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

To avoid usingis orare depending on the number of messages, let's rewrite it to something like:

Suggested change
if (!$io->confirm(\sprintf('There is %d message%s to remove. Doyou want tocontinue?',$idsCount,$idsCount>1?'s' :''))) {
if (!$io->confirm(\sprintf('Can you confirmyou want toremove %d message%s?',$idsCount,1 ===$idsCount ?'' :'s'))) {

arnaud-deabreu reacted with thumbs up emoji
@fabpotfabpotforce-pushed thefeature/messenger-delete-failed-message-by-class-filter branch fromfae8ce5 to1924719CompareMarch 24, 2025 08:02
@fabpot
Copy link
Member

Thank you@arnaud-deabreu.

arnaud-deabreu reacted with heart emoji

@fabpotfabpot merged commit322995c intosymfony:7.3Mar 24, 2025
3 of 11 checks passed
@xabbuhxabbuh mentioned this pull requestMar 24, 2025
xabbuh added a commit that referenced this pull requestMar 24, 2025
This PR was merged into the 7.3 branch.Discussion----------[Messenger] fix test| Q             | A| ------------- | ---| Branch?       | 7.3| Bug fix?      | no| New feature?  | no| Deprecations? | no| Issues        | related to#59978 (comment)| License       | MITCommits-------0ec778b fix test
OskarStark added a commit to symfony/symfony-docs that referenced this pull requestMar 24, 2025
…ger:failed:remove` command (arnaud-deabreu)This PR was squashed before being merged into the 7.3 branch.Discussion----------[Messenger] Add `--class-filter` option to the `messenger:failed:remove` command| Q             | A| ------------- | ---| Feature PR |symfony/symfony#59978| PR author(s) | `@arnaud`-deabreu| Merged in | 7.3| Doc issue |Fix#20805The `--class-filter` was added in the `messenger:failed:remove` command in this [PR](symfony/symfony#59978).As the option already exists in the `messenger:failed:show` I'm wondering if only adding this example could be enough ?Commits-------bdca4e9 [Messenger] Add `--class-filter` option to the `messenger:failed:remove` command
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@chalasrchalasrchalasr approved these changes

@fabpotfabpotfabpot approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

5 participants
@arnaud-deabreu@OskarStark@chalasr@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp