Skip to content

Start & end location timestamps#126

Merged
jackpf merged 10 commits intomainfrom
stored-location-more-fields
Jan 23, 2026
Merged

Start & end location timestamps#126
jackpf merged 10 commits intomainfrom
stored-location-more-fields

Conversation

@jackpf
Copy link
Owner

@jackpf jackpf commented Jan 23, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jackpf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the location history tracking system by introducing a more granular StoredLocation data model. Instead of a single timestamp, each stored location now captures a startTimestamp, an optional endTimestamp, and a count of occurrences. This change allows the system to better represent periods of time a device spent at a specific location and to aggregate duplicate location reports efficiently. The modifications span the data model, repository interfaces, persistence layers (both in-memory and SQLite), and are thoroughly tested to ensure robustness and accuracy.

Highlights

  • Enhanced Location Data Model: The StoredLocation model now includes startTimestamp, endTimestamp, and count to provide a more comprehensive history of location entries, replacing a single timestamp field.
  • Database Schema Update: The underlying SQLite database schema has been modified to persist these new timestamp and count fields, ensuring data integrity and historical tracking.
  • Improved Duplicate Location Handling: Logic for storing and updating locations has been refined to correctly manage duplicate entries by updating endTimestamp and incrementing count for existing locations rather than creating new records.
  • Comprehensive Test Coverage: Existing unit and integration tests have been updated, and new integration tests added, to validate the correct behavior of the new location data model and its persistence across various scenarios, including duplicate entries.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively implements start and end timestamps for location grouping, which is a great enhancement. The changes are consistently applied across the entire stack, from the protobuf definitions to the database layer and tests. The test coverage for the new functionality is also solid.

I've identified a potential issue in how duplicate locations are updated, which could lead to incorrect data if location events arrive out of order. I've included a review comment with a suggested fix to make the implementation more robust. Overall, this is a well-executed feature.

@jackpf
Copy link
Owner Author

jackpf commented Jan 23, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant change to how location data is stored. Instead of storing every location update as a new entry, it now groups duplicate or nearby locations. A single StoredLocation now contains startTimestamp, endTimestamp, and a count of updates, replacing the single timestamp. This change is reflected across the data model, protobuf definitions, database schema, repositories, and tests. The UI has also been updated to display this new information, including the duration a device was at a particular location. The changes are well-implemented and tested. I have one suggestion to improve database query performance by aligning an index with the query patterns.

@jackpf jackpf merged commit aea02a4 into main Jan 23, 2026
4 checks passed
@jackpf jackpf deleted the stored-location-more-fields branch January 23, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant