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

Feature/mob 3281 show bubble internally with overlay false #1028

Open
wants to merge 36 commits into
base: development
Choose a base branch
from

Conversation

Pelkar
Copy link
Collaborator

@Pelkar Pelkar commented May 6, 2024

Jira issue:
https://glia.atlassian.net/browse/MOB-3281

What was solved?
Even with setUseOverlay(false) we are still showing the chathead in the integrator application. Also added relevant javadoc changes, but those will hopefully be confirmed/modified by Kadri today.

Release notes:

  • Feature
  • Ignore
  • Release notes (Is it clear from the description here?)
  • Migration guide (If changes are needed for integrator already using the SDK - what needs to be communicated? Add underneath please)

Additional info:

  • Is the feature sufficiently tested? All tests fixed? Necessary unit, acceptance, snapshots added? Check that at least new public classes & methods are covered with unit tests

BitriseBot and others added 30 commits March 21, 2024 15:11
Fixes issue with the Flutter example app which had a similar package name.

MOB-3216
Add reminder that will help us to consider keeping logs unified between platforms.

MOB-3229
Request only when push notifications set up
- Chat screen — right before the first engagement request
- Secure messaging — before sending the first message
- Fix warning - Consider using 'tasks.register' to avoid unnecessary configuration
- Upgrade core and appCompat to the maximum versions supporting api-33
- Refactoring
- Add comments describing the Media projection requirements

MOB 3232
gugalo and others added 4 commits April 30, 2024 14:42
Since Widgets SDK and Core SDK are being uploaded to same AWS bucket and content is also the same (everything inside module 'build/dokka' folder) I have added unique keyword for Widgets SDK path.

MOB-3172
Copy link
Collaborator

@DavDo DavDo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@AndriiHorishniiMOC AndriiHorishniiMOC left a comment

Choose a reason for hiding this comment

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

Looks good, but it would be great to have a unit tests for those cases.

@Pelkar
Copy link
Collaborator Author

Pelkar commented May 8, 2024

Looks good, but it would be great to have a unit tests for those cases.

Testing this is really complicated because 1. most of its components are untested 2. main logic is in an abstract class and would thus need testing in multiple final classes that override the abstract class. I can do this if we think this is warranted, but it will probably take an additional day or so

@@ -23,8 +23,12 @@ internal abstract class IsDisplayChatHeadUseCase(
) {
abstract fun isDisplayBasedOnPermission(): Boolean

open operator fun invoke(viewName: String?): Boolean {
return isBubbleEnabled() && isDisplayBasedOnPermission() && isShowForEngagement(viewName)
open operator fun invoke(viewName: String?, internal: Boolean = false): Boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please help me to understand, where is the value of USE_OVERLAY setting taken into account? I see that for isDisplayApplicationChatHeadUseCase internal is always true. I see that if not passed , internal is false. But what if permission for showing a bubble outside of the app is granted and USE_OVERLAY is true - will the bubble be shown outside of the app? I cannot find this case in the code. 🤔

Copy link
Collaborator

@gugalo gugalo May 15, 2024

Choose a reason for hiding this comment

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

To be honest I am not sure if my input is what you wanted to know but....
As far as I know the USE_OVERLAY flag now is used only to decide whether to request system permission for system overlays on engagement start. We don't use it in other places because later on we just check whether that system permission is available or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on my testing, with permission enabled and USE_OVERLAY set to false, bubble is still shown inside and outside the app. Which is not expected, as far as I understand, isn't it? As far as I understand, bubble should not be shown if USE_OVERLAY is false. Could you please test this case on your own manually?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am guessing you had the overlay permission already set to allowed before changing the use_overlay parameter to false, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I fixed the issue in the latest fixup

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The result of the last fix is:

  • Bubble is always shown internally
  • Bubble is shown outside application with permission and USE_OVERLAY is true
  • Even with granted permission, but USE_OVERLAY false the bubble will not be shown outside the application

@@ -23,8 +23,12 @@ internal abstract class IsDisplayChatHeadUseCase(
) {
abstract fun isDisplayBasedOnPermission(): Boolean

open operator fun invoke(viewName: String?): Boolean {
return isBubbleEnabled() && isDisplayBasedOnPermission() && isShowForEngagement(viewName)
open operator fun invoke(viewName: String?, internal: Boolean = false): Boolean {
Copy link
Collaborator

@gugalo gugalo May 15, 2024

Choose a reason for hiding this comment

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

To be honest I am not sure if my input is what you wanted to know but....
As far as I know the USE_OVERLAY flag now is used only to decide whether to request system permission for system overlays on engagement start. We don't use it in other places because later on we just check whether that system permission is available or not.

@andrews-moc
Copy link
Contributor

@Pelkar I would like to take some time to review PR carefully once again because there are lots of bubble test cases. By the way, have you tested them after the changes?

@Pelkar
Copy link
Collaborator Author

Pelkar commented May 23, 2024

bubble test cases

I have tested the feature extensively, but I will go through the specific test cases right now

@Pelkar
Copy link
Collaborator Author

Pelkar commented May 23, 2024

tested more thoroughly, one issue came up, for some reason there are two bubbles shown, all functionality is correct, but there is just a duplicate

@andrews-moc
Copy link
Contributor

tested more thoroughly, one issue came up, for some reason there are two bubbles shown, all functionality is correct, but there is just a duplicate

It might be that one is a "local" bubble, the second - is "global".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants