Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Fix: Stop timestamp doesn't work correctly with empty value on data browsing panel

Issue

When the stop timestamp field is left empty in the data browsing panel, it shows only older records instead of all records up to the current time. This is because the code falls back to using the entryInfo.latestRecord timestamp which is loaded once on mount and never updated.

Plan

  • Analyze the issue and understand the root cause
  • Fix the getRecords function to handle undefined end time correctly
  • Add/update tests to verify the fix
  • Address PR feedback about removing unnecessary variables
  • Run linter and tests
  • Request code review

Changes Made

  • Modified getRecords function in EntryDetail.tsx to pass start and end directly to the query without intermediate variables
  • Removed unnecessary fallback to entryInfo?.oldestRecord for start time and entryInfo?.latestRecord for end time
  • When start or stop fields are empty, the query now uses undefined allowing it to query from the beginning or up to the current time
  • Added comprehensive tests to verify the fix:
    • Test that empty stop field queries with undefined end time
    • Test that filled stop field queries with the specified end time

Test Results

  • ✅ All 398 tests pass
  • ✅ TypeScript type checking passes
  • ✅ Code formatting passes
  • ✅ Code review: No issues found
  • ✅ Security scan (CodeQL): No vulnerabilities found

Security Summary

No security vulnerabilities were discovered or introduced by this change.

Original prompt

This section details on the original issue you should resolve

<issue_title>Bug: Stop timestamp doesn't work correctly with empty value on the data browsing panel</issue_title>
<issue_description>### What happened?

My entry has two records. If the stop field has the current time then I see both records:

Image\

if it is empty I see only one:

Image

Version

1.12.1

OS

Linux

Snippet to repeat the bug

You can see the bug on the play server in the demo/test entry.

Logs

Code of Conduct

  • I agree to follow this project's Code of Conduct</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 22, 2026 07:30
Co-authored-by: AnthonyCvn <26444489+AnthonyCvn@users.noreply.github.com>
Co-authored-by: AnthonyCvn <26444489+AnthonyCvn@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix stop timestamp not working with empty value Fix empty stop timestamp querying stale entry metadata Jan 22, 2026
Copilot AI requested a review from AnthonyCvn January 22, 2026 07:38
Copy link
Member

@AnthonyCvn AnthonyCvn left a comment

Choose a reason for hiding this comment

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

rangeStart also can be undefined, and the tests

Co-authored-by: AnthonyCvn <26444489+AnthonyCvn@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 22, 2026

rangeStart also can be undefined, and the tests

Fixed in 6755ba6. Both start and end are now passed directly to the query without fallback to entry metadata.

@AnthonyCvn AnthonyCvn marked this pull request as ready for review January 22, 2026 14:40
@AnthonyCvn AnthonyCvn requested review from atimin and Copilot and removed request for AnthonyCvn and Copilot January 22, 2026 14:40
@AnthonyCvn AnthonyCvn merged commit d0f9c74 into main Jan 22, 2026
5 checks passed
@AnthonyCvn AnthonyCvn deleted the copilot/fix-stop-timestamp-issue branch January 22, 2026 15:04
@AnthonyCvn AnthonyCvn removed the request for review from atimin January 22, 2026 15:04
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.

Bug: Stop timestamp doesn't work correctly with empty value on the data browsing panel

2 participants