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

Unread rooms: Move the storage file to a better location #1730

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

manuroe
Copy link
Contributor

@manuroe manuroe commented Mar 3, 2023

It was previously stored alongside rooms:

├── rooms
│   ├── !TDpKIKrKaCXyncpKsH:localhost:8480
│   │   ├── messages
│   │   ├── state
│   │   └── threadedReadReceipts
│   └── unreadRooms

This created an unexpected behavior because the method MXFileStore.countOfRooms() is based on number of items in the rooms folder. The result was the app recomputing room summaries on each startup if there were unread rooms: https://github.com/matrix-org/matrix-ios-sdk/blob/v0.25.2/MatrixSDK/MXSession.m#L470

The file is not at an upper level.

@manuroe manuroe force-pushed the manu/fix_unread_file_location branch from fc75558 to aee67fc Compare March 3, 2023 08:28
@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.01 🎉

Comparison is base (f52a4d2) 37.53% compared to head (9b62e51) 37.54%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1730      +/-   ##
===========================================
+ Coverage    37.53%   37.54%   +0.01%     
===========================================
  Files          612      612              
  Lines        96235    96266      +31     
  Branches     41603    41618      +15     
===========================================
+ Hits         36119    36142      +23     
- Misses       59041    59071      +30     
+ Partials      1075     1053      -22     
Impacted Files Coverage Δ
MatrixSDK/Data/Store/MXFileStore/MXFileStore.m 17.28% <0.00%> (-0.10%) ⬇️
MatrixSDKTests/MXRoomTests.m 0.00% <0.00%> (ø)
MatrixSDKTests/MXHTTPAdditionalHeadersUnitTests.m 72.34% <0.00%> (-12.77%) ⬇️
MatrixSDK/Utils/MXHTTPClient.m 47.70% <0.00%> (-0.34%) ⬇️
...Data/Store/MXRealmCryptoStore/MXRealmCryptoStore.m 69.93% <0.00%> (-0.22%) ⬇️
MatrixSDK/MXSession.m 39.87% <0.00%> (ø)
MatrixSDK/MXRestClient.m 27.23% <0.00%> (ø)
MatrixSDK/Data/MXRoomState.m 52.80% <0.00%> (ø)
MatrixSDKTests/MXBaseKeyBackupTests.m 64.75% <0.00%> (ø)
MatrixSDKTests/MatrixSDKTestsE2EData.m 72.91% <0.00%> (ø)
... and 8 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

It was previously stored alongside rooms:
```
├── rooms
│   ├── !TDpKIKrKaCXyncpKsH:localhost:8480
│   │   ├── messages
│   │   ├── state
│   │   └── threadedReadReceipts
│   └── unreadRooms
```

This created an unexpected behavior because the method `MXFileStore.countOfRooms()` is based on number of items in the `rooms` folder.
The result was the app recomputing room summaries on each startup if there were unread rooms: https://github.com/matrix-org/matrix-ios-sdk/blob/v0.25.2/MatrixSDK/MXSession.m#L470

The file is not at an upper level.
@manuroe manuroe force-pushed the manu/fix_unread_file_location branch from aee67fc to 9b62e51 Compare March 3, 2023 09:35
@manuroe manuroe requested a review from flescio March 3, 2023 09:36
Copy link
Contributor

@flescio flescio left a comment

Choose a reason for hiding this comment

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

LGTM!

@manuroe manuroe merged commit aee49b2 into develop Mar 3, 2023
@manuroe manuroe deleted the manu/fix_unread_file_location branch March 3, 2023 10:44
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