-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Allow Elixir projects to read flags from a local file (#106)
**Requirements** - [x] I have added test coverage for new or changed functionality - [x] I have followed the repository's [pull request submission guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests) - [ ] I have validated my changes against all supported platform versions **Context** While trying to configure our Elixir service to read feature flags from a local file (for local development purposes), we ran into an issue where the server SDK would throw an "unsupported extension" error, even though the configured path pointed to a YAML file. **Root cause** Erlang uses charlists to represent strings, while Elixir uses binaries. So when we pass a path to a YAML file to the `ldclient` config in our Elixir project, the Erlang function that parses the file extension on the SDK side receives a binary, which it does not support. Thus, the SDK throws an error claiming that we're using an invalid file type. **Describe the solution you've provided** This PR adds a helper function that handles binary type strings. If the `FilePath` is a binary, we simply convert it to a charlist. --------- Co-authored-by: Luis Beligante <[email protected]>
- Loading branch information
1 parent
b709a19
commit c290599
Showing
4 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters