-
Notifications
You must be signed in to change notification settings - Fork 746
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
Start DM on first message (UI) #6051
Conversation
0bef89f
to
f62b4d0
Compare
...-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomTask.kt
Outdated
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomTask.kt
Outdated
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomTask.kt
Outdated
Show resolved
Hide resolved
we can use the |
vector/src/main/res/layout/item_timeline_event_merged_room_creation_stub.xml
Outdated
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomTask.kt
Outdated
Show resolved
Hide resolved
|
||
// Wait for room to be created in DB | ||
try { | ||
awaitNotEmptyResult(realmConfiguration, TimeUnit.MINUTES.toMillis(1L)) { realm -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my understanding, are we relying on another task to asynchronously update the room entity? if possible it would be safer to sequentially run the tasks rather than rely on a timeout (is this a common pattern in the sdk?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ouchadam I agree with you, I'd like to remove it but I have a non-systematic but recurrent crash when I try to navigate to the local room (in the stacktrace, it seems that we try to navigate to un unknown room). It's a bit confusing because the awaitTransaction seems ok, I can log the entity before returning the roomId from the task. Did I miss something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second task is waiting to get the room from the sync but in the current case, the room is created locally and put in DB, so we should not have to wait for it 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the cross conversations, I did not see @ouchadam 's comments at first sight.
Please see my suggestion at #6051 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just replacing with this line can help (I let you do some test):
// Ensure that Realm is up to date before returning the roomId. monarchy.doWithRealm { it.refresh() }
It continues crashing...
* This room will not be synchronized with the server and will not come back from the sync, so all the events related to this room will be generated | ||
* locally. | ||
*/ | ||
suspend fun createLocalRoom(createRoomParams: CreateRoomParams): String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking out loud about about the api design~ not a blocker!
from a consumer api perspective, are local rooms semantically the same as normal rooms? would we handle interacting with rooms differently if they're normal vs local?
I'm wondering if CreateRoomParams
could have a isLocal
option and reusing createRoom
and leaveRoom
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add CreateLocalRoomTask interface and remove DI annotations
* develop: (174 commits) Bump libphonenumber from 8.12.50 to 8.12.51 LoadRoomMember: fix presence Cleanup LoadRoomMembers: add changelog LoadRoomMembers: handle room member event a bit more efficiently LoadRoomMembers: exclude Membership.Leave LoadRoomMembers: divide by chunk Bump soloader from 0.10.3 to 0.10.4 Code review fix. Try no using the gradle daemon on CI Harmonize values of `CI_GRADLE_ARG_PROPERTIES` removing unused dependencies and marking soloader and ignored from dependency check (as it's dynamic) Remove non necessary prefix in logs Adding changelog entry Updating the unit tests Stopping existing active live when starting a new one Avoid multiple PR from Dependabot when Flipper is upgraded. Change context inside the get live summary use case Use a TestDispatcher in the FakeSession Code review fixes. ...
* develop: (91 commits) Remove unused import Update versions Update CHANGES Improve readability. Weblate: also clean trads Changelog Format file Add android:hasFragileUserData="true" to the manifest. See details in #2352 Clean the TODO delete (UnusedResource not compatible with string template) showing a toast on password reset confirmation lifting duplicated event_base layout to the base class, with the option for children to override using vector model for consistency Replace 5 manual steps to 1 command line step Translated using Weblate (Italian) Translated using Weblate (Swedish) Translated using Weblate (Swedish) Translated using Weblate (Russian) extracting common breaker background selection to ftue extensions removing unused imports adding changelog entry ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I focused my review on the SDK part.
...droid/src/main/java/org/matrix/android/sdk/api/session/room/model/localecho/RoomLocalEcho.kt
Show resolved
Hide resolved
createLocalRoomSummaryEntity(realm, roomId, createRoomBody) | ||
} | ||
|
||
// Wait for room to be created in DB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need to wait in this case. We are not waiting for a sync response including the new room.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just replacing with this line can help (I let you do some test):
// Ensure that Realm is up to date before returning the roomId.
monarchy.doWithRealm { it.refresh() }
...-android/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateRoomTask.kt
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/delete/DeleteLocalRoomTask.kt
Outdated
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/delete/DeleteLocalRoomTask.kt
Show resolved
Hide resolved
...droid/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimeline.kt
Outdated
Show resolved
Hide resolved
vector/src/debug/java/im/vector/app/features/debug/features/DebugVectorFeatures.kt
Outdated
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomTask.kt
Outdated
Show resolved
Hide resolved
...oid/src/main/java/org/matrix/android/sdk/internal/session/room/create/CreateLocalRoomTask.kt
Outdated
Show resolved
Hide resolved
* develop: (156 commits) adding test case for showing html entities are processed adding tests around the event html rendering - the test helper is a little hacky in order to covert the spans to something human readable removing extra line adding changelog entry overriding the default list handler with an implementation that takes into account the initial starting position trigger CI Use executeTransactionAwait (need realm refresh in this case) Bump flipper from 0.152.0 to 0.153.0 Use executeTransactionAwait (need realm refresh in this case) generating 1.4.27 changelog and updating version Fixing crash when sharing plain text, such as a url Fix crashes when opening Thread (#6463) Timeline: fix validation of timeline event changes Fix ConcurrentModificationException on BackgroundDetectionObserver Fix crashes when opening Thread (#6463) suppressing unused string resource Changelog Fix ConcurrentModificationException on BackgroundDetectionObserver Fix typo adding changelog entry ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved given we change the title to "Direct message" (singular)
* develop: Group if together io.element.android:opusencoder:1.0.3 - should fix lint false positive issues Indentation, move comment above the block. Do the check on towncrier only for PR targeting develop branch Format file io.element.android:opusencoder:1.0.1 Add a VectorFeatures to force usage of the library OpusEncoder Add dependency to opusencoder and remove module from this project shorter name Add GitHub action to check for a towncrier file
* develop: Comment the GHA towncrier, there is a syntax error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
SonarCloud Quality Gate failed. |
Type of change
Content
This PR displays a "fake" local timeline after selecting the users to create a DM. Sending a message or event is not handled yet, so the real room cannot be created for now.
The flow is hidden behind a debug feature flag accessible from the debug menu.
Motivation and context
UI: #5525
Screenshots / GIFs
start_dm_on_first_msg.mp4
Tests
Tested devices
Checklist