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

Avoid accessing private members of child modules #229

Merged
merged 4 commits into from
Sep 29, 2023

Conversation

dustyholmes-wf
Copy link
Contributor

Motivation

In dart 2.19 mocks can no longer handle calls into these private members.

Changes

Wrap calls into _parentContext in a try...catch to handle this gracefully.

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Architecture member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

In dart 2.19 mocks can no longer handle calls into these private members. Perform the call carefully.
@aviary2-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

) {
try {
childModule?._parentContext = context;
} catch (e) {}
Copy link
Member

@robbecker-wf robbecker-wf Sep 29, 2023

Choose a reason for hiding this comment

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

It might be good to add a comment inside the {} saying that swallowing the exception and not logging or acting on it is intentional so someone doesn't come along later and remove this try catch thinking that it doesn't do anything.

@robbecker-wf
Copy link
Member

+10 @Workiva/release-management-p

Copy link
Contributor

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole7-wk rmconsole7-wk merged commit d5c469b into master Sep 29, 2023
7 checks passed
@rmconsole7-wk rmconsole7-wk deleted the fix-2.19-mock-issue branch September 29, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants