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

Fix crash in RawRepresentable parsing by throwing couldNotConvert #85

Closed
wants to merge 1 commit into from
Closed

Fix crash in RawRepresentable parsing by throwing couldNotConvert #85

wants to merge 1 commit into from

Conversation

MrAlek
Copy link
Contributor

@MrAlek MrAlek commented Apr 27, 2017

This prevents a crash if receiving an unexpected enum case. Instead, the code will throw an error.

I suggest this should be merged in as a hot fix, creating a 0.5.7 release.

I'm also about to make optional enums parse as nil instead of throwing an error to make the client more robust to schema changes. Would you consider it a good default behavior? Ideally, you would both get nil for that enum case and an error in the GraphQLResult struct but I don't know if that's tricky in the current framework code.

@apollo-cla
Copy link

@MrAlek: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@MrAlek
Copy link
Contributor Author

MrAlek commented May 4, 2017

@martijnwalraven Could you have a look at this? :)

@martijnwalraven
Copy link
Contributor

Yep, sorry I didn't get to this sooner. It looks like a reasonable fix, but master is in a weird state right now. If I merge this, I'm not sure how to do a 0.5.7 release based just on 0.5.6 + this fix. Any suggestions?

I hope we can do a proper new release next week, after I've merged some remaining WIP.

@MrAlek
Copy link
Contributor Author

MrAlek commented May 4, 2017

I would branch off 0.5.6, merge this in manually & release a 0.5.7 tag from that branch, then merge into master.

@martijnwalraven
Copy link
Contributor

Yeah, I was afraid it would involve some manual Git sorcery :) I can see how I can branch off 0.5.6 and merge this in to do a 0.5.7 release, but I don't think I can just merge that into master without creating conflicts and messing up the history.

I'd rather not spend time on this now, because the sooner I can finish the remaining work, the sooner we can do a proper new release, including this fix.

@MrAlek
Copy link
Contributor Author

MrAlek commented May 4, 2017

I'd consider this a pretty important fix since without it, any app using the framework crashes if a server would update its schema with a new enum value. For us though, it's no problem, we're running our own fork meanwhile.

Something to consider might be to use a git flow branching strategy for this repo. Then you could have a develop branch where active development on bigger releases is at, while fixes & small improvements can still be merged into master.

@martijnwalraven
Copy link
Contributor

Yeah, I should have handled this better. In most cases, I think development should happen on separate PRs. But because I was making some major changes and didn't want people to work on PRs based on an outdated master, I figured merging the WIP would make things easier. I hadn't expected it to take this long though...

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 this pull request may close these issues.

3 participants