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

fix: crashing message composer input [WPB-8727] #2988

Merged
merged 11 commits into from
May 10, 2024

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented May 8, 2024

BugWPB-8727 [Android] Crash when using tapping on input field while trying to type a message


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

The app is crashing sometimes when clicking on the message composer input.

Causes (Optional)

Changing readOnly parameter probably messes something up with the inner text field state so that it ends up with java.lang.IllegalStateException: LayoutCoordinate operations are only valid when isAttached is true.

Solutions

Getting rid of readOnly is not possible because it was introduced some time ago to fix some other issues that we had with message composer and keyboard.
New BasicTextField2 resolves multiple issues that the previous generation of text input had, including this one. BasicTextField2 has been renamed to regular BasicTextField in newest compose library; the difference is that new one takes TextFieldState instead of TextFieldValue or String.
We decided to use this new version of text field for the message composer. In order to do that, a new hybrid WireTextField2 is created which allows us to use the new generation of text input but also to still pass TextFieldValue and onValueChanged callback to make this refactor as minimally invasive as possible. This WireTextField2 uses StateSyncingModifier which is based on compose BasicTextFieldWithValueOnValueChangeSample which allows to synchronise between TextFieldState and TextFieldValue with onValueChanged callback.
It's needed to update the compose-foundation library to 1.7.0-alpha05, from which BasicTextField2 has been marked as stable and still older BasicTextField is available. In versions prior to chosen one, including current newest release version - 1.6.7, BasicTextField2 has some bad issues with the keyboard (https://issuetracker.google.com/issues/339171226) and interaction source (https://issuetracker.google.com/issues/327665606). To use this version, rememberRipple() needs to be updated to ripple() and AnchoredDraggableState also requires decayAnimationSpec.

Testing

How to Test

Open conversation screen and click on message composer input right after navigating, preferably on Graphene OS.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link
Contributor

github-actions bot commented May 8, 2024

Test Results

927 tests   927 ✅  12m 30s ⏱️
123 suites    0 💤
123 files      0 ❌

Results for commit bf36f2f.

♻️ This comment has been updated with latest results.

@saleniuk saleniuk requested review from Garzas, a team, MohamadJaara, vitorhugods, mchenani and ohassine and removed request for a team May 8, 2024 15:59
@AndroidBob
Copy link
Collaborator

Build 4687 failed.

Copy link
Contributor

github-actions bot commented May 8, 2024

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4688 failed.

Copy link
Contributor

github-actions bot commented May 8, 2024

APKs built during tests are available here. Scroll down to Artifacts!

Copy link
Contributor

@Garzas Garzas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent job 🎸 small comments about dimensions 💪

@AndroidBob
Copy link
Collaborator

Build 4690 failed.

@AndroidBob
Copy link
Collaborator

Build 4691 failed.

Copy link
Contributor

github-actions bot commented May 9, 2024

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4698 failed.

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@yamilmedina
Copy link
Contributor

It is failing in CI because of

e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/CameraButton.kt:25:34 Packages cannot be imported
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/CameraButton.kt:65:34 Unresolved reference: ripple
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/CameraFlipButton.kt:24:34 Packages cannot be imported
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/CameraFlipButton.kt:49:34 Unresolved reference: ripple
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/DeclineButton.kt:24:34 Packages cannot be imported
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/DeclineButton.kt:48:34 Unresolved reference: ripple
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/MicrophoneButton.kt:25:34 Packages cannot be imported
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/MicrophoneButton.kt:52:34 Unresolved reference: ripple
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/SpeakerButton.kt:25:34 Packages cannot be imported
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/SpeakerButton.kt:52:34 Unresolved reference: ripple
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/common/AppExtensions.kt:24:34 Packages cannot be imported
e: file:///home/megazord/builder-agent/android-reloaded-builder/workspace/AR-build-pipeline@2/app/src/main/kotlin/com/wire/android/ui/common/AppExtensions.kt:65:22 Unresolved reference: ripple

Copy link
Contributor

APKs built during tests are available here. Scroll down to Artifacts!

@AndroidBob
Copy link
Collaborator

Build 4709 succeeded.

The build produced the following APK's:

@saleniuk saleniuk merged commit 163d5ab into release/candidate May 10, 2024
12 checks passed
@saleniuk saleniuk deleted the fix/message-composer-input-crash branch May 10, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants