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

Arguments have other encodings than utf-8 #28

Open
jvoges opened this issue Dec 5, 2019 · 1 comment
Open

Arguments have other encodings than utf-8 #28

jvoges opened this issue Dec 5, 2019 · 1 comment
Labels

Comments

@jvoges
Copy link

jvoges commented Dec 5, 2019

Jobs don't get queued when arguments have invalid (non utf-8) encoding. Also you get a valid ID.

Expected Behavior

\Resque::enqueue() should fail with a meaningful error message

Current Behavior

\Resque::enqueue() returns with a valid ID but there is no job in the Redis-DB.

Possible Solution

Throw an exception, when json_encode in Resque::push() fails and check return value when Resque::push() gets called in Job::create()

Steps to Reproduce

    Resque::enqueue('jobs', 'Test_Job', [
        'myStr' => utf8_decode('Düsseldorf'),
    ])

My Environment

  • PHP-Resque version: 1.3
  • PHP version: 7.2.24
  • Redis version: 2:3.0.6-1ubuntu0.4
  • Server type and version: php-cli
  • Operating System and version: 2:3.0.6-1ubuntu0.4
@jvoges jvoges added the bug label Dec 5, 2019
@danhunsaker
Copy link
Member

I'd happily accept a PR with this change.

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

2 participants