Skip to content

Conversation

kinyoklion
Copy link
Member

No description provided.

const store: LDFeatureStore = {
get(
kind: DataKind,
flagKey: string,
Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't just flags.

throw new Error(`Error deserializing ${kindKey}`);
}
callback(item[kindKey][flagKey]);
switch (kind.namespace) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't super elegant, but lets us keep the types the same, and we can make it more elegant in the next update.

return parsed;
}

/**
Copy link
Member Author

Choose a reason for hiding this comment

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

Just because this isn't a permanent solution, and isn't a function we want a customer to use.

@kinyoklion kinyoklion marked this pull request as ready for review April 28, 2023 17:28
}

interface FlagsAndSegments {
[key: string]: { [name: string]: Flag } | { [name: string]: Segment };
Copy link
Member Author

Choose a reason for hiding this comment

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

FlagsAndSegments isn't intended to be addressed by strings. In places where it isn't flags or segments it would generally be an error. So, this is the main thing I was concerned about.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe long term DataKind needs to be flags | segments instead of string. But this is out of scope and out of time for my ambitions now.

export interface DataKind {
  namespace: 'flags' | 'segments';
}

@yusinto yusinto merged commit 469330d into yus/sc-199318/fix-edge-sdks-serialization-bug Apr 28, 2023
@yusinto yusinto deleted the rlamb/suggestion-serialization branch April 28, 2023 19:22
yusinto added a commit that referenced this pull request Apr 28, 2023
#107)

* fix: fixed bug where the feature store does not deserialize KV values correctly.

* chore: remove eslint comment

* chore:update example to target rules rather than a contrived scenario.

* chore: improve logging and nullish check.

* chore: add yarn coverage

* chore: debugging null debugEventsUntilDate

* chore: set debugEventsUntilDate for unit tests.

* fix: Suggestions for serialization. (#111)

fix: Suggestions.

* chore: removed .only

* fix: broken unit tests. minor syntax improvements.

---------

Co-authored-by: Yusinto Ngadiman <yus@launchdarkly.com>
Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
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