Skip to content

Update run to reset log suppression after running component #486

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
merged 3 commits into from
Mar 1, 2024

Conversation

FraserGreenroyd
Copy link
Contributor

@FraserGreenroyd FraserGreenroyd commented Mar 1, 2024

NOTE: Depends on

BHoM/BHoM_Engine#3307

Issues addressed by this PR

Fixes #485

Additional comments

You may be wondering why I've opted to query the suppression state to then reset it, however, the use case for this is if a user of visual programming has, for whatever reason, opted to suppress things themselves, we don't want to blindly reset the suppression after a method runs in case it failed to reset it itself.

The UX on that would be this:

  • User sets error suppression to true
  • User runs component which also sets warning suppression to true
  • Component crashes out and does not reach the reset option
  • UI resets suppression, error suppression is now false along with warning suppression
  • User is confused as to why their error suppression isn't working

This could also be the case for methods which don't crash:

  • User sets error suppression to true
  • User runs component which also sets warning suppression to true
  • Component runs happily, and component resets the suppression log as advised in the docs, error and warning suppression are now turned off
  • User is confused as to why their error suppression isn't working

Therefore, the way of doing it in this PR allows for this UX instead:

  • User sets error suppression to true
  • User runs component that does it's thing correctly or not
  • UI resets suppression
  • UI sets suppression to the values the user had set them to before running the method
  • User is not confused because error suppression is still working regardless of what the method did

Now, we can debate whether a user should ever be suppressing their own errors or not as much as we like (and I would gladly welcome it), however, BHoM philosophy is that methods are reflected up at all times, which is the case for suppressing events as well, which means that, regardless of how we feel as to whether users should do that, they can do it and thus we need to support that UX.

Hopefully that all makes sense!

Edit to capture a conversation had with @IsakNaslundBh:

While this works well for the use cases above and the use case captured in #485 , this does now mean the following situation is possible:

  • User tries to set error suppression to true
  • Component finds that error suppression was false at the start, and resets suppression to that after running the component to start suppression

It's a convoluted system however, @IsakNaslundBh and I have both agreed this is an acceptable risk at this time because:

  • Users are unlikely to be trying to suppress events on the UI compared to the risk highlighted in Make components always unsuppress event recordings at end of their run #485
  • This is a new set of features for this beta so it may be 1 beta with a bit of a problem but the problem has a workaround
  • UX is therefore unchanged - the behaviour this beta around event suppression for a user in visual programming is the same as the 7.0 beta, and we can workshop solutions in the 7.2 milestone

@FraserGreenroyd FraserGreenroyd self-assigned this Mar 1, 2024
@FraserGreenroyd FraserGreenroyd added the type:feature New capability or enhancement label Mar 1, 2024
@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot check compliance

Copy link

bhombot-ci bot commented Mar 1, 2024

@FraserGreenroyd to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

There are 12 requests in the queue ahead of you.

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot check core

Copy link

bhombot-ci bot commented Mar 1, 2024

@FraserGreenroyd to confirm, the following actions are now queued:

  • check core

There are 12 requests in the queue ahead of you.

Copy link

bhombot-ci bot commented Mar 1, 2024

@FraserGreenroyd just to let you know, I have provided a check-versioning result to this Pull Request as it was detected to be linked to other Pull Requests in a series. The comment which triggered this check came from @FraserGreenroyd on BHoM_Engine

Copy link

bhombot-ci bot commented Mar 1, 2024

@FraserGreenroyd just to let you know, I have provided a check-installer result to this Pull Request as it was detected to be linked to other Pull Requests in a series. The comment which triggered this check came from @FraserGreenroyd on BHoM_Engine

Tom-Kingstone
Tom-Kingstone previously approved these changes Mar 1, 2024
Copy link
Contributor

@Tom-Kingstone Tom-Kingstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, and doesn't break current bhom UI function. Also correctly resets the error suppression to what it was originally.

@Tom-Kingstone
Copy link
Contributor

@BHoMBot check ready-to-merge

Copy link

bhombot-ci bot commented Mar 1, 2024

@Tom-Kingstone to confirm, the following actions are now queued:

  • check ready-to-merge

@Tom-Kingstone Tom-Kingstone dismissed their stale review March 1, 2024 12:51

did more testing and found that stopping suppression no longer works

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot check versioning
@BHoMBot check installer
@BHoMBot check compliance
@BHoMBot check core

Copy link

bhombot-ci bot commented Mar 1, 2024

@FraserGreenroyd to confirm, the following actions are now queued:

  • check versioning
  • check installer
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check core

Copy link
Contributor

@Tom-Kingstone Tom-Kingstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval based on discussion, and after testing, errors are suppressed within the called method if the method suppresses, and suppression is reset after method call.

@Tom-Kingstone
Copy link
Contributor

@BHoMBot check ready-to-merge

Copy link

bhombot-ci bot commented Mar 1, 2024

@Tom-Kingstone to confirm, the following actions are now queued:

  • check ready-to-merge

@FraserGreenroyd FraserGreenroyd merged commit c49e518 into develop Mar 1, 2024
@FraserGreenroyd FraserGreenroyd deleted the BHoM_Engine-#3306-QuerySuppression branch March 1, 2024 14:33
@bhombot-ci bhombot-ci bot mentioned this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make components always unsuppress event recordings at end of their run
2 participants