Skip to content

fix(firestore): preserve update timestamps in list_sessions#5640

Open
kkj333 wants to merge 1 commit intogoogle:mainfrom
kkj333:fix/firestore-list-sessions-update-time-5632
Open

fix(firestore): preserve update timestamps in list_sessions#5640
kkj333 wants to merge 1 commit intogoogle:mainfrom
kkj333:fix/firestore-list-sessions-update-time-5632

Conversation

@kkj333
Copy link
Copy Markdown

@kkj333 kkj333 commented May 8, 2026

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):
Closes: #5632

Problem

FirestoreSessionService.list_sessions() always sets Session.last_update_time to 0.0, even when Firestore documents contain updateTime.

Solution

Use the same timestamp conversion logic as get_session() in list_sessions():

  • if updateTime is a datetime, use .timestamp()
  • otherwise, attempt float(updateTime)
  • fallback to 0.0 when conversion fails
    This keeps list responses consistent with get_session() and preserves accurate update timestamps.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.
    Updated tests:
  • test_list_sessions_with_user_id
  • test_list_sessions_without_user_id
    Local pytest summary:
  • tests/unittests/integrations/firestore/test_firestore_session_service.py
  • 17 passed
    Manual End-to-End (E2E) Tests:
    Reproduced with a mocked Firestore client where session docs include updateTime; before fix last_update_time was 0.0, after fix it matches the Firestore value.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 8, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Populate Session.last_update_time from Firestore updateTime in list_sessions so
session listings report accurate timestamps instead of always returning 0.0.
@kkj333
Copy link
Copy Markdown
Author

kkj333 commented May 8, 2026

The failing check is caused by the triaging workflow configuration, not by this PR changes.

adk_pr_triaging_agent fails with:
404 NOT_FOUND: models/gemini-2.5-pro is not found for API version v1beta

Could a maintainer please update the triaging agent model (or rerun after fixing the workflow config)?

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.

Firestore Session Service does not handle timestamp correctly

1 participant