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

Bugfix/4605/fix duplicate messages #4641

Merged
merged 3 commits into from
Jan 22, 2025

Conversation

mahibi
Copy link
Collaborator

@mahibi mahibi commented Jan 22, 2025

fix #4605

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

This is necessary especially to cancel the long polling when configuration change was made, e.g. screen was rotated. Otherwise multiple long polling requests would be running after configuration changes.

Because it not possible to launch a new coroutine in a scope that was canceled, it is necessary to re-initialize the scope.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Because long polling may have to be informed that the scopep was cancelled, the isActive checks are added so it can't happen that messages are added when they shouldn't.

I could not reproduce the scenario, anyway the checks should make sense in my opinion.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
…cyle event)

handleOnStop will handle this (and more scenarios than just backpress)

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi added the 3. to review Waiting for reviews label Jan 22, 2025
@mahibi mahibi added this to the 21.0.0 milestone Jan 22, 2025
@mahibi mahibi requested a review from rapterjet2004 January 22, 2025 13:07
@mahibi mahibi self-assigned this Jan 22, 2025
Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4641-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings104104
Errors3636

SpotBugs

CategoryBaseNew
Bad practice66
Correctness222222
Dodgy code7171
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total310310

@rapterjet2004 rapterjet2004 merged commit 1ac537b into master Jan 22, 2025
18 checks passed
@rapterjet2004 rapterjet2004 deleted the bugfix/4605/fixDuplicateMessages branch January 22, 2025 17:29
@migulen
Copy link

migulen commented Jan 24, 2025

@mahibi , @rapterjet2004 , I think that something related to his PR is making that some messages are "duplicated" on the DB, at the server, and saved, how must be, duplicated on the local DB on the mobile.

I don't known how to replicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicated messages in chat
3 participants