8000 Wrong time if you workout during midnight · Issue #422 · LiamMorrow/LiftLog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

< 8000 bdi class="js-issue-title markdown-title">Wrong time if you workout during midnight #422

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

Closed
Steccah opened this issue Mar 18, 2025 · 6 comments · Fixed by #427
Closed

Wrong time if you workout during midnight #422

Steccah opened this issue Mar 18, 2025 · 6 comments · Fixed by #427
Labels
bug Something isn't working

Comments

@Steccah
Copy link
Contributor
Steccah commented Mar 18, 2025

If you workout during midnight the timestamp changes the hour but not the day:

SessionId Timestamp Exercise Weight WeightUnit Reps TargetReps
43e6300b-d0bd-470e-b89f-0bb39e10da53 2025-03-17T23:53:23 Triceps Pushdown 15 kg 14 15
43e6300b-d0bd-470e-b89f-0bb39e10da53 2025-03-17T23:56:41 Triceps Pushdown 15 kg 13 15
43e6300b-d0bd-470e-b89f-0bb39e10da53 2025-03-17T00:01:38 French Press 15 kg 10 10
43e6300b-d0bd-470e-b89f-0bb39e10da53 2025-03-17T00:04:41 French Press 15 kg 10 10

And then when it calculates the session length it has high values:

Image

I am on android, app version 2.28.1

@Steccah Steccah added the bug Something isn't working label Mar 18, 2025
@Steccah
Copy link
Contributor Author
Steccah commented Mar 18, 2025

And if i correct the csv to restore, the app crashes. Probably it's because it doesn't handle two days in the same workout

@LiamMorrow
Copy link
Owner
LiamMorrow commented Mar 18, 2025

And if i correct the csv to restore, the app crashes. Probably it's because it doesn't handle two days in the same workout

Ah actually this is a safeguard I should put in. The app does not support importing from CSV at all. It is purely an export. The backup / restore functionality is the only way to get data into liftlog. No CSV import will work.

Related: #392

@LiamMorrow
Copy link
Owner

This problem is an artifact of the fact that Sessions are stored like this:

session1:
	date: 2025-03-15
    exercises:
      - Bench Press
		- Set1: 12:30PM
		- Set2: 12:31PM

So as you can see, the exercise sets don't store the date that they were completed at, only the time of day. This does unfortunately lead to these inconsistencies for sessions that cross days :(

It would be possible to migrate to a system where sets include the date as well as the time, so will put that on the backlog

@Steccah
Copy link
Contributor Author
Steccah commented Mar 20, 2025

I'm working on a solution but i can't promise it will work

@LiamMorrow
Copy link
Owner

No worries. I have some guidance on what I was thinking, just a braindump:

  1. In the recorded sets, I'd store a separate Date (DateOnly) and Time (TimeOnly). This avoids DateTime which is tricky to work with correctly
  2. Only amend the v2 models in protobuf, I will be dropping support for v1 shortly - just default to Date.Now (although you could get it working if you like the challenge)

If you don't get it working that's okay, I will get to this eventually. Right now my time is taken up by #420 though so it would be at the very least a month away

@Steccah
Copy link
Contributor Author
Steccah commented Mar 20, 2025

i fixed most things here, but there is one annoying bug, after midnight the timer does not reset when you click a new set, and i can't find the code responsible for the reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0