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

Avoid StackOverflowError when opening chat (kotlin2.0 fix) #3974

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

mahibi
Copy link
Collaborator

@mahibi mahibi commented Jun 18, 2024

followup to #3970

When opening the chat the app crashed with

2024-06-18 10:59:45.039 30757-30757 AndroidRuntime com.nextcloud.talk2 E FATAL EXCEPTION: main
Process: com.nextcloud.talk2, PID: 30757
java.lang.StackOverflowError: stack size 8192KB
at com.nextcloud.talk.ui.MessageInput.getMessageSendButton(MessageInput.kt:75)

Hint in AS was:
Now field from base class com.stfalcon.chatkit.messages.MessageInput shadows the property with custom getter from derived class com.nextcloud.talk.ui.MessageInput. This behavior will be changed soon in favor of the property. Please use explicit cast to com.stfalcon.chatkit.messages.MessageInput if you wish to preserve current behavior. See https://youtrack.jetbrains.com/issue/KT-55017 for details

The issue is caused by the update to kotlin2.0.
Calling the super fields fixes the issue.

🏁 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?)

When opening the chat the app crashed with

2024-06-18 10:59:45.039 30757-30757 AndroidRuntime          com.nextcloud.talk2                  E  FATAL EXCEPTION: main
  Process: com.nextcloud.talk2, PID: 30757
  java.lang.StackOverflowError: stack size 8192KB
  at com.nextcloud.talk.ui.MessageInput.getMessageSendButton(MessageInput.kt:75)

Hint in AS was:
Now field from base class com.stfalcon.chatkit.messages.MessageInput shadows the property with custom getter from derived class com.nextcloud.talk.ui.MessageInput. This behavior will be changed soon in favor of the property. Please use explicit cast to com.stfalcon.chatkit.messages.MessageInput if you wish to preserve current behavior. See https://youtrack.jetbrains.com/issue/KT-55017 for details

The issue is caused by the update to kotlin2.0.
Calling the super fields fixes the issue.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi added this to the 19.1.0 milestone Jun 18, 2024
@mahibi mahibi requested a review from sowjanyakch June 18, 2024 09:56
@mahibi mahibi self-assigned this Jun 18, 2024
Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings7990
Errors10129

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1111
Dodgy code8484
Internationalization33
Malicious code vulnerability33
Performance66
Security11
Total114114

Lint increased!

Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/3974-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.

@mahibi mahibi merged commit cb933be into master Jun 18, 2024
18 of 19 checks passed
@mahibi mahibi deleted the bugfix/noid/fixCrashWhenOpenChat branch June 18, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant