Gitea: [BUG] Due date format issue

Created on 30 Oct 2018  路  17Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 5fc0a12

  • Can you reproduce the bug at https://try.gitea.io:

    • [x] Yes
    • [ ] No
    • [ ] Not relevant

I guess the following image would explain the issue better.

capture

kinbug

All 17 comments

On which page do you currently experience this issue?

It is on issue page

We already have multiple issues regarding this, should we use some library to handle date formatting?

But I saw the response of "https://try.gitea.io/api/v1/repos/{userName}/{repoName}/issues/1/deadline" in the chrome console is 401

And the request payload is {due_date: "2017-02-17T00:00:00.000Z"}

This issue seems not caused by error formating

@kanocz anything in the logs?

I only have the browser console log.

screen shot 2018-10-31 at 7 43 44 pm

Actually, I have some trouble to run gitea on my local.

@kanocz What was the response?

Also, if you have problems running Gitea locally, feel free to ask in our Discord server or the forum.

[Macaron] 2018-10-31 21:10:17: Completed POST /api/v1/repos/Kee1234/gggg/issues/1/deadline 401 Unauthorized in 8.82763ms

I got this on my local environment.

The response was 401. Since the client ajax call got the 401 error, the js function setDeadline() handle the error in the same way. So it shows the "The due date is invalid or out of range. Please use the format 'yyyy-mm-dd' " on the page.

This also happens in the Swagger dashboard for the same request.

Looks like this was broken by #4840 (among other things)

@kolaente Yes, I trace the code and make some experiments. I found that

ctx.Data["IsApiToken"] = true

does not be executed while checking user is signed.

So

func reqToken() macaron.Handler {
    return func(ctx *context.Context) {
        for  key := range ctx.Data{
            fmt.Printf("Key: %s |Value: %v\n", key, ctx.Data[key])
        }
        if true != ctx.Data["IsApiToken"] {
            ctx.Error(401)
            return
        }
    }
}

always gets 401 error.

#5249 shows the solution to fix this bug

I've opened #5249 to fix this and other issues.

why this issue is closed?

Problem still here:

image

on https://try.gitea.io

It looks like it returns an error 500, so maybe some other thing is broken and the error message is just not good...

Yep, it send a payload:
image
and receive nothing
image

@nikitasius could you confirm that #5250 didn't resolve the issue?

@nikitasius could you confirm that #5250 didn't resolve the issue?

Hi, it was on your official demo. If you don't see on your official demo same error - guess it's fixed. Just check.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

BRMateus2 picture BRMateus2  路  3Comments

kifirkin picture kifirkin  路  3Comments

jorise7 picture jorise7  路  3Comments

lunny picture lunny  路  3Comments