Skip to content

Stronger lambda error #4771

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 6 commits into from
May 27, 2025
Merged

Stronger lambda error #4771

merged 6 commits into from
May 27, 2025

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented May 23, 2025

Content

Ensure that lambdaError() really breaks the test in all circumstances.
It can happen that the thrown Error is caught by the code, and this is not something expected.

Also there is a commit to harmonize how we create presenters to test them. I could have created a separate PR but this does not worth it I think.

Motivation and context

More accurate tests
Same code pattern for creating presenter under test.

Screenshots / GIFs

NA

Tests

  • Run all tests, they should not fail

Tested devices

  • NA

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner May 23, 2025 13:51
@bmarty bmarty added the PR-Build For changes related to build, tools, CI/CD label May 23, 2025
@bmarty bmarty requested review from ganfra and removed request for a team May 23, 2025 13:51
Copy link
Contributor

github-actions bot commented May 23, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/yhu1sL

Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.40%. Comparing base (5b9da3c) to head (62ed92f).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4771   +/-   ##
========================================
  Coverage    80.40%   80.40%           
========================================
  Files         2143     2143           
  Lines        56766    56766           
  Branches      7119     7119           
========================================
  Hits         45644    45644           
  Misses        8685     8685           
  Partials      2437     2437           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmartinesp
Copy link
Member

Just my 2 cents here, but I still think the right solution would be to replace runCatching/mapCatching usages with some version of ours that does not catch Error types or coroutine CancellationException. This would be more correct and it might even uncover some issues we might be not aware of in production and were ignored because we catch every possible throwable.

@bmarty
Copy link
Member Author

bmarty commented May 26, 2025

@jmartinesp you're 💯 right and this is probably something we will do at some point. Can you create a new issue (task) with that? In the mean time, the idea of this "quick fix" is to avoid losing time when writing tests, which happened to me a few days ago.

// Instead exit the process to make sure the test fails.
// The error will be:
// "Could not stop all services."
// In this case, but a breakpoint here and run the test in debug mode to identify which lambda is failing.
Copy link
Member

Choose a reason for hiding this comment

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

typo :

put a breakpoint

@bmarty bmarty force-pushed the feature/bma/strongerLambdaError branch from 564a375 to c02f6df Compare May 27, 2025 14:35
Copy link

@bmarty bmarty enabled auto-merge (squash) May 27, 2025 15:21
@bmarty bmarty merged commit 4572419 into develop May 27, 2025
29 checks passed
@bmarty bmarty deleted the feature/bma/strongerLambdaError branch May 27, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Build For changes related to build, tools, CI/CD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants