Skip to content
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

fix: restore context after block.call #318

Merged
merged 1 commit into from Jan 27, 2024
Merged

Conversation

iberianpig
Copy link
Owner

@iberianpig iberianpig commented Jan 27, 2024

closes: #317

ref: iberianpig/fusuma-plugin-wmctrl#14 (comment)

If return is called in the with_context block, the context cannot be restored to its original state.
The "ensure" clause call post-processing even if it called returned in the middle of block.call.

The following problems were occurring:

  1. First, config_params.fetch is called, :plugin_default_context is used as Context for the search
  2. Then when Executor#executable? is called, the search is executed with :plugin_default_context
  3. Because Executor#executable? returns false, wmctrl is not executed.

If return is called in the with_context block, the context cannot be restored to its original state.
The "ensure" clause call post-processing even if it called returned in the middle of block.call.
@iberianpig iberianpig marked this pull request as ready for review January 27, 2024 08:53
@iberianpig iberianpig added the bug label Jan 27, 2024
@iberianpig iberianpig merged commit 5bceddd into main Jan 27, 2024
4 checks passed
@iberianpig iberianpig deleted the fix/searcher-context_with branch January 27, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config::Searcher.with_context does not reset context after execution
1 participant