-
Notifications
You must be signed in to change notification settings - Fork 28
[FSSDK-11578] Ruby: Update impression event handling and send notification for global holdout #376
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
Merged
esrakartalOpt
merged 6 commits into
master
from
esra/FSSDK-11578_impression_and_notification
Oct 22, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2959432
[FSSDK-11578] Ruby: Update impression event handling and send notific…
esrakartalOpt 67f2e13
Merge branch 'master' of https://github.com/optimizely/ruby-sdk into …
esrakartalOpt 1712fc7
Fix lint issues
esrakartalOpt c446e69
Fix lint issue
esrakartalOpt fbe1cfb
Fix lint and test case errors
esrakartalOpt ee1c8fb
Update the "get_holdouts_for_flag" comment
esrakartalOpt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,8 @@ def initialize(datafile, logger, error_handler) | |
return unless @holdouts && [email protected]? | ||
|
||
@holdouts.each do |holdout| | ||
next unless holdout['status'] == 'Running' | ||
|
||
holdout_key = holdout['key'] | ||
holdout_id = holdout['id'] | ||
|
||
|
@@ -633,16 +635,17 @@ def rollout_experiment?(experiment_id) | |
@rollout_experiment_id_map.key?(experiment_id) | ||
end | ||
|
||
def get_holdouts_for_flag(flag_key) | ||
def get_holdouts_for_flag(flag_id) | ||
# Helper method to get holdouts from an applied feature flag | ||
# | ||
# flag_key - Key of the feature flag | ||
# flag_id - (REQUIRED) ID of the feature flag | ||
# This parameter is required and should not be null/nil | ||
# | ||
# Returns the holdouts that apply for a specific flag | ||
|
||
return [] if @holdouts.nil? || @holdouts.empty? | ||
|
||
@flag_holdouts_map[flag_key] || [] | ||
@flag_holdouts_map[flag_id] || [] | ||
end | ||
|
||
def get_holdout(holdout_id) | ||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
HAven't done event handling yet for holdouts myself, but I wonder here, it could be a potential bug if flag_key is used accidentally instead of flag_id in this PR. Are there any checks needed to make sure we use flag_id?
I'm not 100% sure, just pointing to this in case a check is needed. Does swift sdk has any additional guards maybe etc
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.
We can a comment for better clarification. For Swift
flag_id
is none optional, so there is no way to pass null value.