Skip to content

feat(Pausable)!: make pa_[un]pause return bool#91

Merged
mooori merged 3 commits into
masterfrom
pausable-returns
Mar 13, 2023
Merged

feat(Pausable)!: make pa_[un]pause return bool#91
mooori merged 3 commits into
masterfrom
pausable-returns

Conversation

@mooori
Copy link
Copy Markdown
Contributor

@mooori mooori commented Mar 13, 2023

Makes pa_pause and pa_unpause return a bool that indicates whether the feature is newly (un)paused. This corresponds to the return values of std::collections::HashSet methods insert and remove.

Closes this external issue.

Other changes: events

This PR also changes event emitting behavior. Sneaking it into this PR since it only reorders code in the two functions that are modified here.

Previously events Pause and Unpause were emitted even if:

  • State was not modified since the feature was alreay (un)paused.
  • The function panicked because state could not be serialized.

To avoid this, code that emits events has been moved past actions that may fail.

Breaking changes

  • pa_pause and pa_unpause return bool (previously no return value).
  • Pause and Unpause events are only emitted when state is successfully modified.

@mooori mooori marked this pull request as ready for review March 13, 2023 11:03
@mooori mooori requested a review from birchmd March 13, 2023 11:03
@mooori mooori merged commit 8853caf into master Mar 13, 2023
@mooori mooori deleted the pausable-returns branch March 13, 2023 14:06
This was referenced Mar 27, 2026
This was referenced Apr 7, 2026
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.

3 participants