Skip to content

Conversation

@raju-opti
Copy link
Contributor

Summary

  • Instead of saving an expiresAt time in event store, save the storedAt time instead. This will allow expiring event early which was save with a larger ttl before.

Test plan

Issues

  • FSSDK-12028

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the event storage mechanism to save the storedAt timestamp and ttl separately instead of a computed expiresAt timestamp. This enables dynamic event expiration based on the current store's TTL configuration rather than the TTL at the time of storage.

Key Changes:

  • Changed StoredEvent type from storing expiresAt to storing _time object with storedAt and ttl fields
  • Updated expiration logic to calculate expiration dynamically using current store TTL
  • Maintained backward compatibility by handling events without time information

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/event_processor/event_store.ts Refactored StoredEvent type and updated set() and processStoredEvent() methods to use new time structure with dynamic TTL-based expiration
lib/event_processor/event_store.spec.ts Updated test names, variable names, and assertions to validate new time-based storage structure
Comments suppressed due to low confidence (1)

lib/event_processor/event_store.spec.ts:211

  • Avoid automated semicolon insertion (93% of all statements in the enclosing function have an explicit semicolon).
    }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@raju-opti raju-opti merged commit 08928a5 into master Nov 17, 2025
13 of 14 checks passed
@raju-opti raju-opti deleted the raju/event_created_at branch November 17, 2025 14:52
@coveralls
Copy link

coveralls commented Nov 17, 2025

Coverage Status

coverage: 78.231%. remained the same
when pulling 37b82c3 on raju/event_created_at
into 4b35644 on master.

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.

4 participants