Skip to content

Use fatalError instead of NPE #6205

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
May 31, 2022
Merged

Use fatalError instead of NPE #6205

merged 3 commits into from
May 31, 2022

Conversation

Johennes
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

As advised by @bmarty here this is switching from an NPE to fatalError to avoid crashing in production builds.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 12

Checklist

Signed-off-by: Johannes Marbach <[email protected]>
@Johennes
Copy link
Contributor Author

I'm not sure if this needs a changelog entry but please tell me if it does.

@ouchadam
Copy link
Contributor

maybe a controversial take, I would prefer to crash, giving the user feedback an unrecoverable error has occurred and the ability to submit logs the next time the app launches

perhaps a topic for the next team sync!

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks!

@bmarty bmarty enabled auto-merge May 31, 2022 12:32
@bmarty bmarty added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label May 31, 2022
@Johennes
Copy link
Contributor Author

Thanks for fixing the unused import @bmarty! 🤦‍♂️

@github-actions
Copy link

Unit Test Results

  34 files   - 112    34 suites   - 112   32s ⏱️ - 2m 3s
  78 tests  - 158    78 ✔️  - 158  0 💤 ±0  0 ±0 
156 runs   - 632  156 ✔️  - 632  0 💤 ±0  0 ±0 

Results for commit df23fd1. ± Comparison against base commit 3cc1951.

This pull request removes 158 tests.
im.vector.app.core.extensions.StringExtensionsTest ‑ given text with RtL unicode override, when checking contains RtL Override, then returns true
im.vector.app.core.extensions.StringExtensionsTest ‑ given text with RtL unicode override, when ensuring ends LtR, then appends a LtR unicode override
im.vector.app.core.extensions.StringExtensionsTest ‑ given text with unicode direction overrides, when filtering direction overrides, then removes all overrides
im.vector.app.core.extensions.StringExtensionsTest ‑ given text without RtL unicode override, when checking contains RtL Override, then returns false
im.vector.app.features.analytics.impl.DefaultVectorAnalyticsTest ‑ given lateinit user properties when valid analytics id updates then identify with lateinit properties
im.vector.app.features.analytics.impl.DefaultVectorAnalyticsTest ‑ given user consent when tracking events then submits to posthog
im.vector.app.features.analytics.impl.DefaultVectorAnalyticsTest ‑ given user consent when tracking screen events then submits to posthog
im.vector.app.features.analytics.impl.DefaultVectorAnalyticsTest ‑ given user has not consented when tracking events then does not track
im.vector.app.features.analytics.impl.DefaultVectorAnalyticsTest ‑ given user has not consented when tracking screen events then does not track
im.vector.app.features.analytics.impl.DefaultVectorAnalyticsTest ‑ when consenting to analytics then updates posthog opt out to false
…

@bmarty
Copy link
Member

bmarty commented May 31, 2022

CI is too long. Should be fine.

@bmarty bmarty disabled auto-merge May 31, 2022 14:37
@bmarty bmarty merged commit 8e5c96a into develop May 31, 2022
@bmarty bmarty deleted the johannes/fatal branch May 31, 2022 14:37
@github-actions
Copy link

Matrix SDK

Integration Tests Results:

  • [org.matrix.android.sdk.session]
    = passed=20 failures=0 errors=0 skipped=3
  • [org.matrix.android.sdk.account]
    = passed=3 failures=0 errors=0 skipped=2
  • [org.matrix.android.sdk.internal]
    = passed=27 failures=1 errors=0 skipped=1
  • [org.matrix.android.sdk.ordering]
    = passed=16 failures=0 errors=0 skipped=0
  • [org.matrix.android.sdk.PermalinkParserTest]
    = passed=2 failures=0 errors=0 skipped=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants