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

Swoole and Bouncer #461

Open
fibis opened this issue Jan 7, 2021 · 5 comments
Open

Swoole and Bouncer #461

fibis opened this issue Jan 7, 2021 · 5 comments
Labels

Comments

@fibis
Copy link

fibis commented Jan 7, 2021

Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks!
(Any non-English issues will be closed immediately.)

  1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)
    PHP 7.4.13
    Swoole 4.5.9

  2. Please provide your Laravel version.
    8.21.0

  3. Which release version of this package are you using?
    2.6.68

  4. What did you do? If possible, provide a recipe for reproducing the error.
    We are using Bouncer for permission management. There is a function to test, if a user has an ability. This function is internal calling $this->gate()->allows($ability, $arguments);, so a Laravel gate function.

If a Swoole worker handle the request the first time, the function to check the ability, is always returning that the user didn't have this ability. Every request after that, the function to check is returning the correct result for the ability check.

I cannot explain why this does not work only with the first request. I also added the BouncerServiceProvider to the providers in the config, like mentioned in this issue. Is therefore maybe an explanation and a solution that also the first request is working?

@Arkanius
Copy link
Member

Hi!

Could you please share a dump of your fist and the following requests?

@fibis
Copy link
Author

fibis commented Jan 12, 2021

@Arkanius sure, what exactly do you need? A simple dd of the request?

@Arkanius
Copy link
Member

Yes, it would be good to check a request that works and the failed request

@fibis
Copy link
Author

fibis commented Feb 3, 2021

The problem is not depending on the request. The same request is first failing and after the first fail it is working, since all Bouncer permissions are loaded and cached.

@flemeur
Copy link

flemeur commented Feb 11, 2021

Hi

I managed to get Bouncer to play nice with Swoole. Maybe this can help you as well? JosephSilber/bouncer#522 (comment)

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

No branches or pull requests

3 participants