-
Notifications
You must be signed in to change notification settings - Fork 309
local echo (7/7): Support simplified version of local echo #1453
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
base: main
Are you sure you want to change the base?
Conversation
988c615
to
f297a65
Compare
aa81e2f
to
28d545f
Compare
0cfc1d3
to
bd7ed4c
Compare
4dbbbfd
to
9ab3f5f
Compare
cd699e1
to
0a12c33
Compare
I've been running on my phone a build with this PR in it for the past few days (as described at #mobile-team > beta release management @ 💬). It works! Glad to see this feature nearing completion. One observation: the loading indicator is pretty conspicuous, and feels too conspicuous in the normal case where the message promptly succeeds.
|
While we do create outbox messages, there are in no way user-visible changes since the outbox messages don't end up in message list views. We create skeletons for helpers needed from message list view, but don't implement them yet, to make the diff smaller. For testing, similar to TypingNotifier.debugEnable, we add MessageStoreImpl.debugOutboxEnable for tests that do not intend to cover outbox messages. Some of the delays to fake responses added in tests are not necessary because the future of sendMessage is not completed immediately, but we still add them to keep the tests realistic.
This 11px whitespace can be traced back to 311d4d5 in 2022, and is not present in the Figma design. It was there to match the web design while prototyping the app.
This adds some overhead in magnitude of O(1) (where the constant is the number of outbox messages in a view, expected to be small) on message event handling. We add outboxMessages as a list independent from messages on _MessageSequence. Because outbox messages are not rendered (the raw content is shown as plain text), we leave the 1-1 relationship between `messages` and `contents` unchanged. When computing `items`, we now start to look at `outboxMessages` as well, with the guarantee that the items related to outbox messages always come after those for other messages. Look for places that call `_processOutboxMessage(int index)` for references, and the changes to `checkInvariants` on how this affects the message list invariants. `addOutboxMessage` is similar to `handleMessage`. However, outbox messages do not rely on the fetched state, i.e. they can be synchronously updated when the message list view was first initialized. This implements minimal support to display outbox message message item widgets in the message list, without indicators for theirs states. Retrieving content from failed sent requests and the full UI are implemented in a later commit.
Thanks! Updated this to use 500ms, and rearranged the paddings to avoid displacement. |
The error text reads a bit funny to me. I think "Message not sent." would be better for the first part. |
screenshots
(This branch can be used to preview the full implementation)
Fixes #1441