Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FF-2501 Include config fetch/publish time with assignment details #102

Conversation

greghuels
Copy link
Contributor

@greghuels greghuels commented Jun 24, 2024

FF-2501

js-client-sdk implements this functionality in Eppo-exp/js-client-sdk#90

Motivation and Context

Implements configFetchTime and configPublishTime to give users a better understanding of which version of the configuration is loaded.

How has this been tested?

Integration testing

@greghuels greghuels changed the base branch from greg/FF-2465/evaluation-reasons to greg/FF-2465/evaluation-reasons-4 June 24, 2024 19:45
@greghuels greghuels requested review from aarsilv and sameerank June 24, 2024 19:45
@greghuels greghuels changed the title Greg/ff 2501/evaluation reasons config time FF-2501 Include config fetch/publish time with assignment details Jun 24, 2024
@@ -209,12 +212,15 @@ export default class EppoClient {
* @param defaultValue default value to return if the subject is not part of the experiment sample
* @returns a boolean variation value if the subject is part of the experiment sample, otherwise the default value
*/
public getBooleanAssignment = (
public getBooleanAssignment(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

arrow functions caused a few TypeScript errors in EppoJSClient, so I reverted back to class methods

@@ -26,7 +26,11 @@ export interface IConfigurationStore<T> {
getKeys(): string[];
isInitialized(): boolean;
isExpired(): Promise<boolean>;
setEntries(entries: Record<string, T>): Promise<void>;
setEntries(entries: Record<string, T>): Promise<boolean>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

setEntries now returns Promise<boolean>. If you resolve with true, it tells js-client-sdk-common to update the configFetchTime and configPublishTime

Comment on lines 19 to 20
this.configurationStore.setConfigFetchTime(new Date().toISOString());
this.configurationStore.setConfigPublishTime(responseData.createdAt);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only set the config fetch/publish time if the serving store was updated

Base automatically changed from greg/FF-2465/evaluation-reasons-4 to greg/FF-2465/evaluation-reasons June 24, 2024 20:03
@greghuels greghuels force-pushed the greg/FF-2501/evaluation-reasons-config-time branch from 0c86c0f to 554ceca Compare June 24, 2024 20:04
Comment on lines 500 to 501
configFetchTime,
configPublishTime,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering -- is it obvious that "time" implies date-time? Thoughts on renaming these?

Suggested change
configFetchTime,
configPublishTime,
configFetchedAt,
configPublishedAt,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can do that. I'll update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated!

@greghuels greghuels merged commit 87ad5d1 into greg/FF-2465/evaluation-reasons Jun 24, 2024
2 checks passed
@greghuels greghuels deleted the greg/FF-2501/evaluation-reasons-config-time branch June 24, 2024 20:34
greghuels added a commit that referenced this pull request Jul 2, 2024
* FF-2501 Include config fetch/publish time with assignment details

* FF-2501 do not use arrow functions for functionality that's extended

* FF-2501 configFetchTime/configPublishTime --> configFetchedAt/configPublishedAt
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.

2 participants