GithubHelp home page GithubHelp logo

Comments (7)

OsiPog avatar OsiPog commented on May 29, 2024 1

I'm that colleague

from onefetch.

spenserblack avatar spenserblack commented on May 29, 2024 1

But I like that "time travel" achievement 😢 😆 But you're right that we could handle this more gracefully.

I think that most people don't pay attention to the commit time, so even if it was an unreasonable value like in the year 3000 it could still get merged in. And if that happens the repo is basically unusable by onefetch unless a maintainer rewrites the history to fix the commit date. So overall we should change this from a panic to a warning message so that at least onefetch can display the other stats, and one unexpected time getting accidentally merged in doesn't "break" the whole repo for onefetch.

Besides the panic, I'm also worried that we're dropping the timezone offset somewhere, which can cause this issue. Do both of you (@OsiPog and @MalteT) live in different timezones, and can you confirm that your system times are correct?

from onefetch.

OsiPog avatar OsiPog commented on May 29, 2024 1

Actually, we live in the same time zone and I can confirm that my system time was in fact incorrect. So I just caused this issue by commiting with my system time being in the future.

from onefetch.

MalteT avatar MalteT commented on May 29, 2024 1

So I think the solution is to print something like could not calculate last change: last commit datetime is in the future and then continue running.

Or time traveler detected, omitting last change calculation to prevent temporal paradox :D

I'm not familiar with the code base, but if the change is not too involved I could assemble a PR :)

from onefetch.

spenserblack avatar spenserblack commented on May 29, 2024

I think we did have a timezone issue, anway 😆 2a3707e

Regardless of who or what caused the issue, I don't think anybody wants to rebase the commit history to fix the commit times just to get onefetch to stop panicking. So I think the solution is to print something like could not calculate last change: last commit datetime is in the future and then continue running.

from onefetch.

spenserblack avatar spenserblack commented on May 29, 2024

Labeling this as an enhancement instead of a bug since the panic was intended behavior.

from onefetch.

spenserblack avatar spenserblack commented on May 29, 2024

Oh, I like that better, actually! All you need to do is filter out commits where the commit time is greater than now.

But to do that some refactoring might be needed to avoid recalculating "now" in multiple places. Ideally SystemTime::now should only be called once per execution.

from onefetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.