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

JsonSerializationException after updating from 4.1 to 4.2 #12

Open
gmatv opened this issue Sep 25, 2020 · 3 comments · May be fixed by #20
Open

JsonSerializationException after updating from 4.1 to 4.2 #12

gmatv opened this issue Sep 25, 2020 · 3 comments · May be fixed by #20

Comments

@gmatv
Copy link

gmatv commented Sep 25, 2020

After updating from 4.1 to 4.2 we get Newtonsoft.Json.JsonSerializationException : Error converting value {null} to type 'System.Single'. Path 'failure_reason', line 1, position 440.

Code to reproduce

var sdk = new NeverBounceSdk(neverbounceConfig.ApiKey);
var jobStatusRequestModel = new JobStatusRequestModel
{
    job_id = jobId
};
JobStatusResponseModel jobStatusResponseModel = await _sdk.Jobs.Status(jobStatusRequestModel);

Response json:

{
  "status": "success",
  "id": 5432650,
  "job_status": "complete",
  "filename": "Advanced mailing 2020-09-25 09-14.csv",
  "created_at": "2020-09-25 03:14:42",
  "started_at": "2020-09-25 03:14:44",
  "finished_at": "2020-09-25 03:16:14",
  "total": {
	"records": 28,
	"billable": 28,
	"processed": 28,
	"valid": 25,
	"invalid": 3,
	"catchall": 0,
	"disposable": 0,
	"unknown": 0,
	"duplicates": 0,
	"bad_syntax": 0
  },
  "bounce_estimate": 10.714285714285714,
  "percent_complete": 100,
  "failure_reason": null,
  "execution_time": 13
}
@Yinamil
Copy link

Yinamil commented Sep 28, 2020

UPDATE: I've manually edited the code and submitted a pull request to fix this issue. Once they approve it and update the version number, you should be able to use this again.
I have a fix to this, but I can't push the change to the origin to create a pull request. 'Unauthenticated'

@paul-aspinall
Copy link

Can we get some movement on this as it's the official package?
You literally cannot check for the status of a job as this library crashes when it deserializes the return JSON.

@KeithHenry
Copy link

@paul-aspinall I've fixed this in a fork at https://github.com/EvolutionJobs/NeverBounce and also upgraded from Newtonsoft.Json to System.Text.Json and added better handling of parse exceptions.

There's a PR #20 to merge that fork back here, but it's not compatible with .NET 4.5

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