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

Implement EngagementLauncher business logic for ongoing live engagement #1206

Open
wants to merge 1 commit into
base: feature/entry-widget-and-secure-conversations-v2
Choose a base branch
from

Conversation

DavDo
Copy link
Collaborator

@DavDo DavDo commented Jan 10, 2025

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

What was solved?

Release notes:

  • Feature(SC + Entry Widget)
  • 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
  • Did you add logging beneficial for troubleshooting of customer issues?
  • Did you add new logging? We would like the logging between platforms to be similar. Refer to Logging from Android SDKsThings to consider for newly added logs in Confluence for more information.

Screenshots:

@DavDo DavDo requested a review from a team as a code owner January 10, 2025 15:26
/**
* Starts a chat engagement.
*
* @param context Activity or Context used to launch the chat screen
* @param visitorContextAssetId Optional visitor context id from Glia Hub
*/
fun startChat(context: Context, visitorContextAssetId: String? = null)
@FeatureUnderConsiderationForRemoval
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What do you think about this solution?
As the @JvmOverloads annotation is not supported for interfaces, integrators using Java must explicitly pass null for visitorContextAssetId. For this reason, I have defined a new function instead.
Later I added this annotation to prevent integrators from using the functions with visitorContextAssetId until they need it. To do that, they have to mark their functions with the @OptIn(FeatureUnderConsiderationForRemoval::class) annotation, otherwise it won't compile.

@@ -22,12 +20,19 @@ internal class HasOngoingSecureConversationUseCase(
secureConversationsRepository.unreadMessagesCountObservable,
engagementStateUseCase()
) { pendingSecureConversations, unreadMessagesCount, state ->
isAuthenticatedUseCase() &&
(pendingSecureConversations || unreadMessagesCount > 0 || state is State.TransferredToSecureConversation)
pendingSecureConversations || unreadMessagesCount > 0 || state is State.TransferredToSecureConversation
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed the isAuthenticatedUseCase() check, as it was included in the unread_messages_count observable on the core SDK side.

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

Successfully merging this pull request may close these issues.

1 participant