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

Crashing in JobBuilder create with custom params #60

Closed
aasatt opened this issue Jan 17, 2018 · 2 comments
Closed

Crashing in JobBuilder create with custom params #60

aasatt opened this issue Jan 17, 2018 · 2 comments
Labels

Comments

@aasatt
Copy link

aasatt commented Jan 17, 2018

Im getting a crash on the assert in this function in the JobBuilder class.

    /// Custom parameters will be forwarded to create method
    public func with(params: [String: Any]) -> Self {
        assert(JSONSerialization.isValidJSONObject(params))
        info.params = params
        return self
    }

Before moving to the new code I was passing things like delegates and callbacks to my job but since those are not valid JSON but conform to Any it crashes on this assertion.

I'm not sure if this is intended or not but it does mention "Validate JSON argument" int the 1.4.0 change log so maybe. If it was intended, is there a better way to get callback blocks and updates from a job?

@lucas34 lucas34 added the bug label Jan 18, 2018
@lucas34
Copy link
Owner

lucas34 commented Jan 18, 2018

Hi,
The params will be converted to string JSON when serialising the task. However, I should only validate this if the persistence is required. I will update this.

@lucas34
Copy link
Owner

lucas34 commented Jan 22, 2018

Will be release in 1.4.1

@lucas34 lucas34 closed this as completed Jan 22, 2018
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