-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Offline support #3952
Offline support #3952
Conversation
88e316e
to
df5a642
Compare
8967a16
to
959f26c
Compare
I'm very interested in this function. Can I help you testing the new feature using the Nextcloud Talk QA App? |
Thanks that would be great, bit of warning though, you might have to login again, and as of now offline conversations are still unimplemented, and offline writing to the server is unavailable. There also might be issues with editing/deleting messages, along with processing read status, and a lot of other bugs as this is a pretty significant (but nevertheless needed) refactoring. Better late than never 😄 |
Can you inform me, if I can test the offline features to give you a feedback of it? You can also contact me to test some other new features if needed 😀. |
db2b781
to
61549ea
Compare
@mahibi
loadMoreMessagesis defined in the OfflineFirstChatRepository. It
loadMoreMessages is also called in the onLoadMore callback. Here, the offset is the last chat message's id in the adapter, rather than the last known message
Unlike initMessagePolling, loadMoreMessages is not in an infinite while loop. So further calls to loadMoreMessages will require a UI trigger event. |
InitMessagePolling
This is a lifecycle aware infinite loop. It should terminate on lifecycle change, and retry every 500 ms on connection loss. I might change that later though. |
update1: it's necessary to also check if the loaded 100 messages itself contains gaps.... @rapterjet2004 thanks for the summary. I just wrote some concept for this, but take it as a draft for now / let me know if it makes sense for you. wenn chat is opened:read last 100 messages from DB (show them, even if they are older) start polling with lastKnownOfflineMessageId At this point, there are no problems until the user does not scroll back beyond the 100 messages. load message historyWhenever scrolling back via onLoadMore, we have to check for gaps when loading offline messages. We want to load the 100 message before this messageX. When scrolling back, this check is made:
(Note that the message id's are NOT continuous! Only higher or lower is important.) Example for a gap:Lets say we have a messageX with id 400 and it's hasNoGapUntilMessageId is 450. We are scrolling back so we want the previous 100 message before message with id 400. The previous 100 messages are fetched from DB. Because 320 < 400 --> There is a gap between message 320 and 400 (so if ids were continuous there would be a gap of 80) Example for no gap:Lets say we have a messageX with id 400 and it's hasNoGapUntilMessageId is 450. We are scrolling back so we want the previous 100 message before message with id 400. The previous 100 messages are fetched from DB. Because 400 >= 400 --> There is no gap |
With the release of 09.07.2024 at 17:49 there are two bugs:
|
Thanks for testing @niclasheinz . Appreciate that 👍 |
27326d7
to
b2927dd
Compare
162f16c
to
50f1b50
Compare
ffb471f
to
a3704d2
Compare
4bf0d06
to
e5f19fc
Compare
Testing
|
9992835
to
dd4df84
Compare
Authors: Julius Linus and Marcel Hibbe Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
was falsely merged, so now reapplying commit 98f8361 Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…o work and show up as temp messages ( I have some creative ideas for the UI ) Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
method was extracted for other purposes but was not used in the end. Anyway it made sense to use it for resumeAudioPlaybackIfNeeded. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
not needed for our requirements + it simplifies code Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
… or remove it otherwise Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Before, old conversations that were left still occurred in the list (only adding+updating was done, but never deleting) also, the list is up to date when coming back from chat. Otherwise there may be unread messages shown for a short moment which were already read. Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
...will be done by foreign keys cascading. Therefore, also added foreign key to ChatBlockEntity Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…es sense remove roomId from Conversation (deprecated. only token should be used) Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…phabetically Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
comment in openHelperFactory Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
dd4df84
to
8885b99
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/3952-talk.apk |
Hello @mahibi and @rapterjet2004 That's great 🎉 . It works well. It would be nice if I could switch offline support on and off for some chats. It would also be great if I could compose and send a message (text, image, audio, poll, location, file or contact) offline and when I am back online this message is sent automatically. But otherwise really good work. Really great. Best regards, Niclas |
Great!!!! I've tested the offline support with my account on nextcloud server version v28.0.4 and works fine, but my account at nextcloud server v25.0.12 can't show any "room" after upgrade the client to Android Nextcloud Talk v20.0.0-RC1. I've uninstalled completly and reinstaled and configured accounts, with the same result. I supose that this version of Android Nextcloud Talk don't have support to older Spreed(talk) servers like v15.0.8. The client Android Nextcloud Talk v19.1.0-RC1 works fine with v28.0.4 and v25.0.12 of nextcloud server. Thanks for all @mahibi & CO!!! |
resolve #217
Authors: @rapterjet2004 @mahibi
Now in Android Documentation for the App's Architecture
🚧 TODO
🏁 Checklist
/backport to stable-xx.x