-
Notifications
You must be signed in to change notification settings - Fork 761
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
Broken getSha and repo.write #147
Comments
Hey mind giving me a bit more info on the broken |
Try running repo.write twice (first to create the file, then to modify it) and it will fail.
It breaks on an uncaught error in XMLHttpRequest() because it is expecting a json response but because the accept header is being sent it is getting back a buffer (raw). Other functions though expect back a buffer - it's a problem because with the merged PRs you have functions that were written expecting different types of responses. |
👍 I'm also experiencing this. Edit: After a bit of investigating, it all goes pete tong at commit af1e5b5. |
Looked at this very briefly today. Commenting out line 62 fixes the issue, but it breaks Will take a closer look tomorrow, submitting a PR if I find a fix. |
I'm seeing this issue as well. Would love to see a fix in master. |
Writing to repos is broken in the master version of the github-api package (see github-tools/github#147) For now, use the branch at https://github.com/aendrew/github/tree/147_fix_getSha_write which seems to fix the issue. Addresses #4423 https://pm.theworkdept.com/issues/4423
Same problem here... Is this repo still supported? Tickets here are very old. |
@s-a I was going to do a PR on this ages ago but haven't gotten around to it. I'm seriously needing this functionality ASAP, so I'll probably try to do so tomorrow. But yeah, it seems fairly under-maintained given how breaking this issue is... |
@s-a Oh wow, I've already even done a PR and just forgot about it. Nevermind then... @michael Are you maintaining this project anymore? If so, would it help if I offered to help co-maintain? My PR from early January that fixes this issue hasn't been merged, and there are ~32 other open pull requests. I can imagine you're super busy with Substance Composer (which looks amazing btw), but I'd really like to see github.js progress — please let me know if there's any way I can help! |
Unfortunately I can't add any contributors but if you want to take over adding tests/testing PRs, I would be happy to merge and roll an npm version for anything you give a 👍. |
@ingalls Sounds like a plan — will see how far I get on my projects today and will start going through the PRs. |
@Aendrew I added you as a collaborator. Thanks for the help! :) |
Only wish I'd have: Try to keep the lib minimal with respect to features. Lib was not intended to be a wrapper around the full Github API, but easy to customize if you need more. |
@michael Amazing, thank you very much! Will definitely respect that. 😄 |
Made returning raw conditional. Fixes #147.
This is currently broken by all the merged pull requests from 11 days ago.
I think it is a problem with the Accept header being set to 'application/vnd.github.v3.raw+json' in #105 but the improved Sha functions etc. from #144 rely on the Accept header being 'application/json' in @darvin commit, but should probably be 'application/vnd.github.v3+json'
However, this change would mean that responses to repo.read with return json with the content base64 encoded, and would break the test on repo.read.
I'm a little confused about how to fix it, since this seems to be a result of different pull requests taking different approaches which are incompatible.
There should also be a test for basic functionality such as writing or updating a file - I'm surprised no one has noticed this breaking change with the new version.
Sorry I can't write a test and help more. It's taken me about 3 hours just trying to understand what is going on and why things are broken now.
The text was updated successfully, but these errors were encountered: