fossteams / teams-cli

A CLI / TUI for Microsoft Teams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to decode json

sp1ritCS opened this issue · comments

Hi, first of all thank you for writing this. I know this is less than alpha quality software, and I'm assuming you are already aware of this, however there doesn't exist an gh issue for it yet.

Depending on the room I want to join, it throws an failed to decode json: json: unknown field "F" where F is either skypeguid, notification\n or meetingObjectsConfig.

I don't know go, but does it really make sense to throw an error if there are additional fields in the json returned from teams. (I mean I see why you'd want that for development, but even there I think a warning should be enough)

Hey!

Thanks for opening this issue!

You're right, fatally fail for such a stupid thing is not the right behavior. I'm kind of doing that on purpose for debugging and because I want to spot all of the possible missing fields, but this obviously gives you a bad UX.

This is where the error happens:
https://github.com/fossteams/teams-api/blob/e72c7911b38c91f35fcbd7681e27b769fd6ecc81/pkg/csa/channels.go#L27

By removing this line, the missing fields are silently ignored. Give me a couple of minutes and I'll rollout a change that will ignore additional fields when in non-debug mode :)

Fixed with a5330d9, please try again and re-open / report back ;)