fix: tmpo pause and tmpo resume now correctly accounts for project context switching#74
Merged
DylanDevelops merged 1 commit intomainfrom Jan 28, 2026
Merged
Conversation
The resume command now resumes the last stopped session for the current project instead of any project. Introduced Database.GetLastStoppedEntryByProject and corresponding tests to support this behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
mainbranch of tmpo.Description
This pull request updates the logic for resuming time tracking sessions to ensure that the resumed session is always associated with the current project. The
resumecommand now looks up the last stopped entry for the detected project, rather than globally, and provides more accurate error messages. The database logic and tests have also been updated to support this change.Resume command improvements:
resumecommand now resumes the last stopped session specifically for the currently configured project, rather than any project. This ensures users only resume sessions relevant to their current context. [1] [2]Database layer changes:
GetLastStoppedEntryByProjectto theDatabaseclass ininternal/storage/db.go, which retrieves the last stopped entry for a given project.cmd/tracking/resume.goto include theprojectpackage, used for detecting the current project.Testing improvements:
GetLastStoppedEntryByProjectininternal/storage/db_test.go, covering multiple scenarios and edge cases.