Skip to content

GetMailingList returns empty struct even though address is present #314

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

Closed
tommed opened this issue Oct 13, 2023 · 4 comments · Fixed by #316
Closed

GetMailingList returns empty struct even though address is present #314

tommed opened this issue Oct 13, 2023 · 4 comments · Fixed by #316

Comments

@tommed
Copy link

tommed commented Oct 13, 2023

I have the code:

log.Printf("fetching mailing list <%s>", address)
ml, err := mg.GetMailingList(c, address)

I check and err is nil. The mailing list returned is an empty struct with nothing set in it.

When I check the log entry, it says:

"fetching mailing list [email protected]"

image

And as you can see, the mailing list '[email protected]' does indeed exist:

image

It is also returned in ListMailingLists with the same address, so I know it is correct.

@tommed
Copy link
Author

tommed commented Oct 13, 2023

The response from the API is returning:

{
  "list": {
    "access_level": "readonly",
    "address": "[email protected]",
  //...
}

But the model you're trying to json serialise it into is mailingListResponse, which uses member:

type mailingListResponse struct {
	MailingList MailingList `json:"member"`
}
var resp mailingListResponse
err = response.parseFromJSON(&resp)
return resp.MailingList, err

Which is probably why resp.MailingList is not being set.

@tommed
Copy link
Author

tommed commented Oct 30, 2023

Is no one monitoring or maintaining this library? You'd expect someone to be doing this given it's an official repo.
Does that mean this code is not being security patched and Dependabot patches aren't being applied?

@thrawn01
Copy link
Contributor

Looks like I introduced this error when I converted the library to local testing. I'll have a PR up in a few moments.

@thrawn01
Copy link
Contributor

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

Successfully merging a pull request may close this issue.

2 participants