Skip to content
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

[BUG] Allowed memory size exhausted on nesting group route #412

Closed
deadsandro opened this issue Mar 29, 2023 · 0 comments · Fixed by #414
Closed

[BUG] Allowed memory size exhausted on nesting group route #412

deadsandro opened this issue Mar 29, 2023 · 0 comments · Fixed by #414
Labels
bug Something isn't working

Comments

@deadsandro
Copy link

Nutgram version

3.17 and 4.x-dev

Describe the bug

for v 3.17
Allowed memory size of .. exhausted in ... vendor\nutgram\nutgram\src\Handlers\CollectHandlers.php on line 97

// commit the handlers
$this->handlers = array_merge_recursive($this->handlers, $this->groupHandlers);

Bug exists only if methods with pattern (onCallbackQueryData and onPreCheckoutQueryPayload) are used in logic on any group level

To Reproduce

$bot->group([
    Middleware\TestMiddlewareB::class,
], function(Nutgram $bot) {
    // works
    $bot->onCallbackQuery([Commands\TestHandler::class, 'test']);
    
    // error
    $bot->onCallbackQueryData('test', [Commands\TestHandler::class, 'test']);
    // OR
    // $bot->onPreCheckoutQueryPayload('test', [Commands\TestHandler::class, 'test']);

    $bot->group([
        Middleware\TestMiddlewareC::class,
        Middleware\TestMiddlewareD::class,
    ], function(Nutgram $bot) {
        $bot->onCommand('start', Commands\TestHandler::class);
        // OR
        // $bot->onPreCheckoutQueryPayload('test', [Commands\TestHandler::class, 'test']);
    });
});

Expected behavior

no errors for nesting groups

Screenshots

No response

Additional context

No response

@Lukasss93 Lukasss93 added the needs triage Waiting for a valid tag label Mar 29, 2023
@Lukasss93 Lukasss93 linked a pull request Mar 29, 2023 that will close this issue
@Lukasss93 Lukasss93 added bug Something isn't working and removed needs triage Waiting for a valid tag labels Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants