-
Notifications
You must be signed in to change notification settings - Fork 0
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
FF-2501 Include config fetch/publish time with assignment details #102
Conversation
@@ -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( |
There was a problem hiding this comment.
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>; |
There was a problem hiding this comment.
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
src/flag-configuration-requestor.ts
Outdated
this.configurationStore.setConfigFetchTime(new Date().toISOString()); | ||
this.configurationStore.setConfigPublishTime(responseData.createdAt); |
There was a problem hiding this comment.
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
0c86c0f
to
554ceca
Compare
src/client/eppo-client.ts
Outdated
configFetchTime, | ||
configPublishTime, |
There was a problem hiding this comment.
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?
configFetchTime, | |
configPublishTime, | |
configFetchedAt, | |
configPublishedAt, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated!
* 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
FF-2501
js-client-sdk implements this functionality in Eppo-exp/js-client-sdk#90
Motivation and Context
Implements
configFetchTime
andconfigPublishTime
to give users a better understanding of which version of the configuration is loaded.How has this been tested?
Integration testing