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

Activity pages (besides Pulse) seem to no longer work #30851

Closed
kemzeb opened this issue May 3, 2024 · 14 comments · Fixed by #30857
Closed

Activity pages (besides Pulse) seem to no longer work #30851

kemzeb opened this issue May 3, 2024 · 14 comments · Fixed by #30857
Labels

Comments

@kemzeb
Copy link
Contributor

kemzeb commented May 3, 2024

Description

Not sure if other users encountered this, but it appears that the contributors, contributor frequency, and recent commit graphs seem to no longer work currently i.e. I don't see any chart data.

To reproduce this, simply look at any of these pages while in a repository with recent commits.

The backend seems fine as I do see JSON responses from the related endpoints (e.g. /{username}/{repo}/activity/data for the Contributors page). Because of this, it looks like this maybe a problem with the frontend.

I also decided to checkout 21331be (when the contributors graph was introduced) and rebuilt my dev environment. Weirdly enough I still have the same problem, so I'm not sure what's going on (maybe some direct/transitive dependency causing this break?).

Gitea Version

53b5522

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

git version 2.44.0

Operating System

Debian

How are you running Gitea?

In a Docker dev container firing up a Gitea dev environment using the launch.json configurations found in Gitea's VSCode docs.

I did also use try.gitea.io and looked for other user repos with chart data but they seem to have the same problem.

Database

SQLite

@kemzeb kemzeb added the type/bug label May 3, 2024
@lunny
Copy link
Member

lunny commented May 3, 2024

It works for me. 0f3e717

@kemzeb
Copy link
Contributor Author

kemzeb commented May 3, 2024

After doing the following:

  • Made my fork up-to-date with gitea's main
  • Built the project with: TAGS="bindata sqlite sqlite_unlock_notify" make build
  • Created a new Gitea repository where I snatched all the commits in a project with 736 commits and merged their main onto mine
  • Navigated to the Contributors page
  • Disabled my browser cache and reloaded the page

I still have the problem:
Screenshot 2024-05-03 at 9 31 28 AM

The x-axis appears to be correct, but I am not seeing any chart data. I also realized that I'm not seeing any contributor graphs. I'm running on a chromium-based browser. I also checked Firefox and Safari (i.e. I'm using MacOS v14.4.1) and encountered the same problem. Not sure what's going on on my end.

Looking for more examples, I encountered the terraform-provider-gitea project where I also see the issue.

@lunny
Copy link
Member

lunny commented May 3, 2024

It works for me both chrome and firefox web browser in macOS.

image

@KazzmanK
Copy link
Contributor

KazzmanK commented May 3, 2024

No issues for me too, in light and dark themes.

@kemzeb , may it be issue with database sync or custom theme?
Admin-Maintenance-> click on all sync operations.

there is no issue with your example
image

Is there something special with your browser ? Errors in console, etc

@kemzeb
Copy link
Contributor Author

kemzeb commented May 3, 2024

No console or network errors, I still see the the JSON responses are successful; I used Safari, Brave, and Firefox and I don't see anything. I also went on a separate Windows machine with Firefox and I still don't see any chart data. I have used both light and dark themes for each browser.

@kemzeb
Copy link
Contributor Author

kemzeb commented May 3, 2024

I have read the PR that introduced this change and my best guess so far has to do with some problem associated to date and time handling (I'm from the US).

@kemzeb
Copy link
Contributor Author

kemzeb commented May 3, 2024

Update: it looks like I am right. I changed my operating system to use a European date and time and I can now see the chart data. I'll see if I can make a patch for this (not a frontend wizard but I have read some of the code last night)!

@kemzeb
Copy link
Contributor Author

kemzeb commented May 4, 2024

Alright working on this 👍

lunny pushed a commit that referenced this issue May 6, 2024
Before this patch, we were using `Date` getter/setter methods that
worked with local time to get a list of Sundays that are in the range of
some start date and end date. The problem with this was that the Sundays
are in Unix epoch time and when we changed the "startDate" argument that
was passed to make sure it is on a Sunday, this change would be
reflected when we convert it to Unix epoch time. More specifically, I
observed that we may get different Unix epochs depending on your
timezone when the returned list should rather be timezone-agnostic.

This led to issues in US timezones that caused the contributor, code
frequency, and recent commit charts to not show any chart data. This fix
resolves this by using getter/setter methods that work with UTC since it
isn't dependent on timezones.

Fixes #30851.

---------

Co-authored-by: Sam Fisher <[email protected]>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue May 6, 2024
Before this patch, we were using `Date` getter/setter methods that
worked with local time to get a list of Sundays that are in the range of
some start date and end date. The problem with this was that the Sundays
are in Unix epoch time and when we changed the "startDate" argument that
was passed to make sure it is on a Sunday, this change would be
reflected when we convert it to Unix epoch time. More specifically, I
observed that we may get different Unix epochs depending on your
timezone when the returned list should rather be timezone-agnostic.

This led to issues in US timezones that caused the contributor, code
frequency, and recent commit charts to not show any chart data. This fix
resolves this by using getter/setter methods that work with UTC since it
isn't dependent on timezones.

Fixes go-gitea#30851.

---------

Co-authored-by: Sam Fisher <[email protected]>
@snoweuph
Copy link

snoweuph commented Jun 3, 2024

will this be in 1.22.1 or will it stay broken till 1.23.0 for stable users?
because I can reproduce it on my Instance running 1.22.0
image

@kemzeb
Copy link
Contributor Author

kemzeb commented Jun 3, 2024

We backported this patch, so it should be included in v1.22.0.

I have done the following:

  • Removed my previous database directory so that it can be rebuilt
  • git checkout v1.22.0
  • TAGS="bindata sqlite sqlite_unlock_notify" make build
  • ./gitea web
  • Created a repository and made 3 commits

And haven't been able to reproduce.

I went to your instance to see if I can gather any useful insights and that's where I noticed that the backend is sending negative Unix times. Here is an example I extracted from inspecting the HTTP responses:

. . .
    "total": {
        "name": "Total",
        "login": "",
        "avatar_link": "",
        "home_link": "",
        "total_commits": 246,
        "weeks": {
            "-62135596800000": {
                "week": -62135596800000,
                "additions": 214923,
                "deletions": 191599,
                "commits": 246
            }
        }
    }
. . .

It doesn't make sense to be getting negative Unix times since they represent times before the Unix epoch.

Given these results, I believe that this is a problem in the backend and we should maybe create a bug report for this.

@snoweuph
Copy link

snoweuph commented Jun 3, 2024

okay?

anything I can do to help debugging rn?

@snoweuph
Copy link

snoweuph commented Jun 3, 2024

Side Information: I did the upgrade to 22 just 3 days ago, so I should have the bugfix already, right?

So I guess, I have a weird bug in thte backend, though I would exspect server and not go binary releated

@kemzeb
Copy link
Contributor Author

kemzeb commented Jun 4, 2024

Side Information: I did the upgrade to 22 just 3 days ago, so I should have the bugfix already, right?

Yes, v1.22.0 should have it.

So I guess, I have a weird bug in thte backend, though I would exspect server and not go binary releated

After looking at the code that builds these Unix times, I haven't been able to determine the cause (or if the problem resides elsewhere). If you wish, you can open a new issue so that we can track this potential bug.

@snoweuph
Copy link

snoweuph commented Jun 4, 2024

Side Information: I did the upgrade to 22 just 3 days ago, so I should have the bugfix already, right?

Yes, v1.22.0 should have it.

So I guess, I have a weird bug in thte backend, though I would exspect server and not go binary releated

After looking at the code that builds these Unix times, I haven't been able to determine the cause (or if the problem resides elsewhere). If you wish, you can open a new issue so that we can track this potential bug.

I just opend up #31248

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants