-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Progress emitter throws error if jobId has comma in it #2003
Comments
I was not aware of this limitation myself, but after examining the code it seems like it is going to be impossible to fix other than renaming the ids so that they do not include commas... |
I will see if there is any possibility improving the lua code that actually pubs the progress event. |
@manast As a quickfix, can we replace Line 401 in 4177e57
I found this line here, Line 100 in 4177e57
job.id + ',' + progress , so since progress can never contain commas, I think it can be guaranteed that the last comma will always be the one separating the progress.
Can you pls confirm if my understanding is correct? I'll raise a PR for the same then. |
but progress can be a json object so it can indeed include commas... |
Which is the scenario when progress can be a json object? Can you please help me find it? |
you can send a complete object as progress |
Oh okay, I didn't know that. Then can we escape commas by passing the entire thing as a stringified json? Line 100 in 4177e57
For example, .updateProgress(keys, [progressJson, JSON.stringify({jobId: job.id, progress})]) |
Let me take a deeper look at this later today and i will give you an answer |
Thank you for looking into this 😀 |
Take a look at the PR, I wrote it so that we are still backwards compatible with the old way of sending the data: #2004 |
Includes fix for commas-in-id bug: OptimalBits/bull#2003
* develop: (39 commits) chore(release): 3.22.3 [skip ci] fix(delayed): re-schedule updateDelay in case of error fixes OptimalBits#2015 chore(release): 3.22.2 [skip ci] chore: fix github token chore: correct release branch test: increase timeout in test chore: add semantic release scripts fix(obliterate): obliterate many jobs fixes OptimalBits#2016 3.22.1 chore: upgrade dependencies chore: update CHANGELOG fix(obliterate): remove repeatable jobs fixes OptimalBits#2012 docs: fix typo docs: update README.md docs: updated README.md Update README.md 3.22.0 docs: update CHANGELOG feat: do not rely on comma to encode jobid in progress fixes OptimalBits#2003 (OptimalBits#2004) 3.21.1 ...
I'm getting an error when I set a jobId that has a comma in it.
On following the error message, I end up on this line
bull/lib/queue.js
Line 404 in 4177e57
I see the code tried to extract the jobId using the location of the first comma, but since the jobId itself has a comma in it, it fails the extract the full jobId, and the remaining text is not parseable by JSON.parse.
I need to fix this urgently since a code in production is breaking. I would be grateful if somebody can guide be on how to best fix this.
The text was updated successfully, but these errors were encountered: