Skip to content

randomizer will pick last item in options set when faced with all-false conditional options and no defined fallback#1985

Merged
bosh merged 1 commit intomissionpinball:devfrom
bosh:forgot_randomizer_guard
Mar 2, 2026
Merged

randomizer will pick last item in options set when faced with all-false conditional options and no defined fallback#1985
bosh merged 1 commit intomissionpinball:devfrom
bosh:forgot_randomizer_guard

Conversation

@bosh
Copy link
Collaborator

@bosh bosh commented Mar 2, 2026

When using a randomizer,

  • with all conditional events,
  • with all conditions resolving false,
  • and with the fallback_value not set
    the current code results in None, which seems reasonable, but may result in odd behavior down the line.

Probably the more right thing to do is to not post any event, but I don't think it's worth spending too much time on these edge cases while randomization is being rewritten.

In any case, if a developer is using all-conditional event sets and can end up with all being false-dropped, its really on them to provide a fallback (even if they want a noop response) to avoid unwanted undefined behaviors (the posting of the last event or none etc).

…se conditional options and no defined fallback

Probably the more right thing to do is to not post any event, but the interfaces around the randomizer are
funky and we might accidentally post None as an event.

In any case, if a developer is using all-conditional event sets and can end up with all being false-dropped,
its really on them to provide a fallback (even if they want a noop response) to avoid unwanted last-choice
event posting as the default fallback.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@bosh bosh merged commit e2c0ca4 into missionpinball:dev Mar 2, 2026
25 checks passed
@bosh bosh deleted the forgot_randomizer_guard branch March 2, 2026 09:15
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.

1 participant