Uh oh!
There was an error while loading. Please reload this page.
[FME-12059] SDK_UPDATE with metadata - #461
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use initalCacheLad instead of isCacheValid
sdk_ready metadata
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| * Metadata keys for SDK update events. | ||
| * Use the string literals directly: 'FLAGS_UPDATE' or 'SEGMENTS_UPDATE' | ||
| */ | ||
| type SdkUpdateMetadataKeys = { |
There was a problem hiding this comment.
I would remove this type in order to simplify the Public API. This type is not used anywhere internally, and from the perspective of the TypeScript user, it doesn't seem very useful:
client.on(client.Event.SDK_UPDATE, (metadata) => {
if (metadata.type === 'FLAGS_UPDATED' as SplitIO.SdkUpdateMetadataKeys['FLAGS_UPDATE']) {
doSomethingForFlagsUpdated
}
});
vs
client.on(client.Event.SDK_UPDATE, (metadata) => {
if (metadata.type === 'FLAGS_UPDATED') {
doSomethingForFlagsUpdated
}
});
I would remove it for now and reconsider adding it or something else in the future.
Besides, we are using union types for similar string enum types (example SDKMode, StorageType, etc).
There was a problem hiding this comment.
what do you think about replacing it with something like
/** * Metadata for the update event emitted when the SDK cache is updated with new data for flags or segments. */typeSdkUpdateMetadata={/** * The type of update event. */type: SdkUpdateMetadataKey/** * The names of the flags or segments that were updated. */names: string[]}/** * Metadata keys for SDK update events. * Use the string literals directly: 'FLAGS_UPDATE' or 'SEGMENTS_UPDATE' */typeSdkUpdateMetadataKey='FLAGS_UPDATE'|'SEGMENTS_UPDATE';[FME-12059] Update readiness promises with `SdkReadyMetadata` object
Uh oh!
There was an error while loading. Please reload this page.
JavaScript commons library
What did you accomplish?
How do we test the changes introduced in this PR?
Extra Notes