Flagsmith / Flagsmith/flagsmith

Store epoch timestamp when writing Identity Entities

Open
#1,539 0 comments 0 reactions 2 assignees Claimed by @gagantrivedi View on GitHub
api improvement
Dominant language
Python
Stars
6.6k
Forks
567
Avg merge
1d 13h
Merged PRs (30d)
121

Description

# Overview

We need to be able to tell whether an Identity has changed, and if the entity that is being stored in memory is stale and needs refreshing. The two current use cases for this requirement are:

- With real time updates, where a client loses then regains a network connection, ascertaining if they have missed an update event message
- With Edge API replication, race conditions can occur where replication lags and clients attempt to update their documents too quickly

# Solution

Whenever an Identity is modified/updated/written to, store the current per-second UNIX epoch time against the Identity.

When sending an Identity to an SDK, send the last-updated epoch time to the SDK. The SDKs can then make use of this data to decide whether they need to refresh their data.

Also related is https://github.com/Flagsmith/flagsmith/issues/1420

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.