HubPress / hubpress.io

A web application to build your blog on GitHub
MIT License
2.81k stars 2.62k forks source link

Changing the title causes a 422 error (Unprocessable Entity). #496

Open jsiu22 opened 7 years ago

jsiu22 commented 7 years ago

So changing the title causes problems when I save.

eg. "= test" to "= Test" or "= test" to "= testing"

A 422 error occurs. (Unprocessable Entity)

jaredmorgs commented 7 years ago

Thanks for the report @jsiu22

I wonder if this has something to do with the GitHub sync state. Could you please force a refresh on your posts list using the refresh button?

If that fails to resolve the 422 error when changing the blog title case, could you take a look in your Browser Console and paste in any errors into this bug.

Thanks for your help.

jsiu22 commented 7 years ago

Yea forcing refresh helps relieve some of the "symptoms". But it still occasionally happens. I've just deleted those and made a new post and that works.

Thanks!

ochaloup commented 7 years ago

Hi,

I have the same trouble and I had have quite a trouble to understand of behavior of the UI which behaves just showing blank white semi-transparent screen with rotating circle but no message what's happening. I found out that I get the errors in console of type

    githubPlugin.js:643 updateHead Error: 422 error making request PATCH https://api.github.com/repos/ochaloup/blog.chalda.cz/git/refs/heads/gh-pages: "Unprocessable Entity"
        at new t (Requestable.js:50)
        at Requestable.js:385
        at <anonymous> undefined
    githubPlugin.js:643 updateHead null true
    Requestable.js:50 Uncaught (in promise) Error: 422 error making request PATCH https://api.github.com/repos/ochaloup/blog.chalda.cz/git/refs/heads/gh-pages: "Unprocessable Entity"
        at new t (Requestable.js:50)
        at Requestable.js:385
        at <anonymous>

and

    Write post Object Object
api.github.com/repos/ochaloup/blog.chalda.cz/contents/_posts/2017-01-01-About-the-blog.adoc Failed to load resource: the server responded with a status of 409 (Conflict)
/hubpress/#/posts/45933cd0-5e01-4943-9dbb-8e017b4b3f33:1 Uncaught (in promise) Error: 409 error making request PUT https://api.github.com/repos/ochaloup/blog.chalda.cz/contents/_posts/2017-01-01-About-the-blog.adoc: "Conflict"
    at new t (vendor.e2e21d9c993fa4b677a1.js:96)
    at vendor.e2e21d9c993fa4b677a1.js:96
    at <anonymous>

Even they are different from user perspective it seems to me similar. It happens when I change already published article (tag, text in it) and want to save it (which means publishing changes). I think that first save works but other ones fails intermittently.

As workaround it seems to help me (either some or all)

I would like really thank you for the great publishing platform just I hit this issue quite often and it's quite obtrusive (at least for me :)

jaredmorgs commented 7 years ago

Yeah I've encountered the same issue as well.

--

Sent from Mobile.

anthonny commented 7 years ago

It happens since i have updated the github lib to communicate with api. I'll investigate

anthonny commented 7 years ago

Hi here, the 0.8.1 is out, could you upgrade your instance and tell me if now everything is ok please?

ochaloup commented 7 years ago

@anthonny sorry for a delay in answering. It works for me much better (said almost fine). When I change the title the change is processed.

There are small but -it's not much obvious if happened or not. The listing (either in the post in administration or at the blog page) does not refresh with the new name immediatelly. I need to check the github account to see if renaming of the post was processed. Refreshing (ctrl+shift+r) to see the change happened takes several times to see it.

Then I hit some intermittent failures. Once happened to me I needed to do the change twice (maybe only my own fault of something) as the first time the title after hitting 'save' was not changed. Once the page got stuck on the rolling waiting circle and there was written some "conflict ..." in the error console. I needed to refresh the page and the change of the tile in fact happened at the background meanwhile.