m-barthelemy / vapor-queues-fluent-driver

A Fluent implementation for https://github.com/vapor/queues (Vapor4)
MIT License
32 stars 16 forks source link

invalid field: data type: Data error: `typeMismatch(Foundation.Data, Swift.DecodingError.Context(codingPath` #20

Closed maximedegreve closed 2 years ago

maximedegreve commented 2 years ago

I create a job using a codable and then when the Job runs it tries to decode the data from the database but it can't be decoded and throws this error:

[ INFO ] Dispatched queue job [job_id: DD7F28B8-8A59-4685-9CFA-2959213F3E0D, job_name: TweetUpdateJob, queue: default]
[ ERROR ] Job run failed: invalid field: data type: Data error: typeMismatch(Foundation.Data, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Data but found an array instead.", underlyingError: nil))

I've created a simple project to explain he bug: Bug.zip

m-barthelemy commented 2 years ago

Thanks for the report and the sample project to reproduce it, much appreciated! Likely to be the same issue as #21 Check if https://github.com/m-barthelemy/vapor-queues-fluent-driver/releases/tag/2.0.0 fixes the problem for you.

m-barthelemy commented 2 years ago

Should (hopefully) be fixed in 3.0.0-beta1

Feel free to reopen an issue if you're still having trouble with the new releases.