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

tweak: Prevent delays from serializing diagrams. #2103

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

cmaddox5
Copy link
Contributor

@cmaddox5 cmaddox5 commented Jul 1, 2024

Asana task: ad-hoc

When a delay is a single page alert, it will try to serialize the diagram. Problem is that the diagram will always consider delays an invalid effect and spams Splunk with warnings for it. Since we know delays never produce a diagram, we can prevent DisruptionDiagram.serialize(t) from being called at all.

Note: I left validate_effect/1 alone because this code is organized in such a way that other widgets can call it. Didn't want to make a ReconstructedAlert assumption in the module because of that. Feel free to push back on that though.

  • Tests added?

@cmaddox5 cmaddox5 requested a review from a team as a code owner July 1, 2024 14:54
Copy link
Contributor

@sloanelybutsurely sloanelybutsurely left a comment

Choose a reason for hiding this comment

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

sounds good to me. did you want to add a test to this?

Copy link

github-actions bot commented Jul 1, 2024

Coverage of commit ff70642

Summary coverage rate:
  lines......: 45.0% (2921 of 6493 lines)
  functions..: 41.0% (1040 of 2535 functions)
  branches...: no data found

Files changed coverage rate:
                                                                          |Lines       |Functions  |Branches    
  Filename                                                                |Rate     Num|Rate    Num|Rate     Num
  ==============================================================================================================
  lib/screens/v2/widget_instance/reconstructed_alert.ex                   |87.1%    341| 100%    46|    -      0

Download coverage report

@cmaddox5
Copy link
Contributor Author

cmaddox5 commented Jul 1, 2024

sounds good to me. did you want to add a test to this?

I think existing tests should cover it. disruption_diagram_test already had a test for delays and assertions for the existing full screen delay tests in reconstructed_alert_test will be the same.

@cmaddox5 cmaddox5 merged commit 641e29d into main Jul 1, 2024
13 checks passed
@cmaddox5 cmaddox5 deleted the cm/prevent-diagram-serialization-delays branch July 1, 2024 15:18
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.

2 participants