Skip to content

Rework the way we init and close the RustMatrixRoom #957

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 2 commits into from
Jul 25, 2023

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jul 24, 2023

Rework the way we init and close the RustMatrixRoom.

Closes #951.

We will be careful when integrating Appyx 2.0.0 regarding potential changes about lifecycle of Node and View...

@github-actions
Copy link
Contributor

📱 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:

innerRoom.backPaginationStatusFlow()
.onEach {
_timeline.postPaginationStatus(it)
return if (isInit.getAndSet(true)) {
Copy link
Member

Choose a reason for hiding this comment

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

should be !isInit.getAndSet(true) or use compareAndSet(false,true)

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you sure? I have swapped the 2 blocks to avoid the negation (and the code is working, even if I do not think it fixes the issue at all, so the draft status of the PR :))

Copy link
Member

@ganfra ganfra Jul 25, 2023

Choose a reason for hiding this comment

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

Ah yes, sorry I missread. I'll push some more commits here, I have a "fix"

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 12.35% and project coverage change: -0.08% ⚠️

Comparison is base (a2975ec) 56.74% compared to head (e35bb73) 56.66%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #957      +/-   ##
===========================================
- Coverage    56.74%   56.66%   -0.08%     
===========================================
  Files          974      977       +3     
  Lines        24681    24726      +45     
  Branches      5009     5011       +2     
===========================================
+ Hits         14005    14012       +7     
- Misses        8459     8495      +36     
- Partials      2217     2219       +2     
Files Changed Coverage Δ
...id/libraries/designsystem/utils/LogCompositions.kt 57.14% <0.00%> (ø)
...droid/libraries/matrix/impl/room/RustMatrixRoom.kt 0.00% <0.00%> (ø)
...braries/matrix/impl/timeline/RustMatrixTimeline.kt 0.00% <0.00%> (ø)
...droid/libraries/matrix/test/room/FakeMatrixRoom.kt 91.08% <0.00%> (-0.59%) ⬇️
...services/analytics/impl/DefaultAnalyticsService.kt 0.00% <0.00%> (ø)
...id/services/analytics/noop/NoopAnalyticsService.kt 0.00% <0.00%> (ø)
...yticsproviders/posthog/PosthogAnalyticsProvider.kt 0.00% <ø> (ø)
...rvices/analyticsproviders/posthog/PosthogConfig.kt 0.00% <ø> (ø)
...alyticsproviders/posthog/log/AnalyticsLoggerTag.kt 0.00% <0.00%> (ø)
...alyticsproviders/sentry/SentryAnalyticsProvider.kt 0.00% <0.00%> (ø)
... and 9 more

... and 2 files with indirect coverage changes

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@bmarty bmarty marked this pull request as ready for review July 25, 2023 10:54
@bmarty bmarty requested a review from a team as a code owner July 25, 2023 10:54
@bmarty bmarty requested review from ganfra and removed request for a team July 25, 2023 10:54
Copy link
Member Author

@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.

LGTM, and I confirm that the issue is fixed. I cannot approve the PR though, maybe @jmartinesp can have a fresh look on it? Thanks!

@bmarty bmarty requested review from jmartinesp and removed request for ganfra July 25, 2023 10:56
@bmarty bmarty changed the title Use an AtomicBoolean instead of a MutableStateFlow to atomically init the RustMatrixRoom Rework the way we init and close the RustMatrixRoom Jul 25, 2023
@bmarty bmarty added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Jul 25, 2023
Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM!

@bmarty bmarty merged commit f27cc5a into develop Jul 25, 2023
@bmarty bmarty deleted the feature/bma/fixRoomCrash branch July 25, 2023 13:48
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.

[Crash] "RoomListItem object has already been destroyed"
3 participants