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

Feature/fga/push subscribe to room #3257

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Jul 30, 2024

Content

Add a feature flag so we can try subscribing to room whenever we receive a notifiable push.

Motivation and context

To improve time to see timeline when opening the app from push notification.

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • 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
  • Pull request includes a sign off
  • You've made a self review of your PR

@ganfra ganfra marked this pull request as ready for review July 30, 2024 15:39
@ganfra ganfra requested a review from a team as a code owner July 30, 2024 15:39
@ganfra ganfra requested review from jmartinesp and removed request for a team July 30, 2024 15:39
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: https://i.diawi.com/WStWzm

@ganfra ganfra added the PR-Misc For other changes label Jul 30, 2024
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Project coverage is 76.11%. Comparing base (b9942cc) to head (08030b5).
Report is 4 commits behind head on develop.

Files Patch % Lines
...raries/push/impl/push/OnNotifiableEventReceived.kt 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3257      +/-   ##
===========================================
- Coverage    76.13%   76.11%   -0.02%     
===========================================
  Files         1647     1647              
  Lines        38787    38801      +14     
  Branches      7530     7533       +3     
===========================================
+ Hits         29529    29534       +5     
- Misses        5347     5355       +8     
- Partials      3911     3912       +1     

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

}
val client = matrixClientProvider.getOrRestore(notifiableEvent.sessionId).getOrNull() ?: return@launch
client.getRoom(notifiableEvent.roomId)?.use { room ->
room.subscribeToSync()
Copy link
Member

Choose a reason for hiding this comment

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

I think that might be instantiating a timeline too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes the goal is also to create and cache a timeline before clicking the notification

@jmartinesp
Copy link
Member

After enabling the developer option I see no /sync in the logs when receiving a notification. So maybe we need to start the sync service until we receive a first sync?

@ganfra
Copy link
Member Author

ganfra commented Jul 30, 2024

After enabling the developer option I see no /sync in the logs when receiving a notification. So maybe we need to start the sync service until we receive a first sync?

I don't know if it's quick enough to wait for the app to be in foreground. Do you see improvements on your side?

@jmartinesp
Copy link
Member

Actually my bad, I thought this PR was about opportunistic syncs when push notifications were received, so we could get updates for other subscribed rooms too, but it's only about optimising loading times for the timeline, right?

To be honest, I see no difference with or without the developer option in the debug build. Maybe it'll be more noticeable in the nightlies. I'll approve it so we can test it there.

@ganfra
Copy link
Member Author

ganfra commented Jul 30, 2024

Ok, lets see and remove it if it's useless

@ganfra ganfra enabled auto-merge July 30, 2024 17:11
@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 30, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jul 30, 2024
@ganfra ganfra merged commit 1cbd03a into develop Jul 30, 2024
31 of 33 checks passed
@ganfra ganfra deleted the feature/fga/push_subscribe_to_room branch July 30, 2024 17:33
@ganfra ganfra mentioned this pull request Jul 31, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants