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

Evan/feature/placement support #664

Merged
merged 36 commits into from
Dec 12, 2023
Merged

Conversation

evantk91
Copy link
Contributor

🔹 Jira Ticket(s) if any

✏️ Description

Please provide a brief description of what this pull request does.

[email protected] and others added 26 commits August 30, 2023 09:16
…age-and-handlers

[MOB-6733] update local storage and handlers
…acement-support

[MOB-7179] updates reset function for placement support
…alization-tests

[MOB-7349] placements serialization tests
@evantk91 evantk91 requested a review from Ayyanchira December 1, 2023 13:56
Evan Greer and others added 3 commits December 4, 2023 13:50
…es-for-placements

[MOB-6731] updates get messages for placement support
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

LGTM. Made some comments

Comment on lines 141 to 156
val localMessageList = getMessages().toMutableList()
val localMessageMap = mutableMapOf<String, IterableEmbeddedMessage>()
localMessageList.forEach {
getMessages(placementId)?.toMutableList()?.forEach {
localMessageMap[it.metadata.messageId] = it
}

// Check for new messages and add them to the local list
remoteMessageList.forEach {
if (!localMessageMap.containsKey(it.metadata.messageId)) {
localMessagesChanged = true
localMessageList.add(it)
IterableApi.getInstance().trackEmbeddedMessageReceived(it)
Copy link
Member

Choose a reason for hiding this comment

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

Needs revisit. Check if the trackEmbeddedMessage is called for previously received message.

Comment on lines 161 to 172
val messagesToRemove = mutableListOf<IterableEmbeddedMessage>()
localMessageList.forEach {
if (!remoteMessageMap.containsKey(it.metadata.messageId)) {
messagesToRemove.add(it)

//TODO: Make a call to the updateHandler to notify that the message has been removed
//TODO: Make a call to backend if needed
localPlacementMessagesMap[placementId]?.forEach {
if (!remoteMessageMap.containsKey(it.metadata.messageId)) {
localMessagesChanged = true
}
}
localMessageList.removeAll(messagesToRemove)

this.localMessages = localMessageList
localPlacementMessagesMap[placementId] = remoteMessageList
Copy link
Member

Choose a reason for hiding this comment

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

Revisit the functionality

@evantk91 evantk91 requested a review from Ayyanchira December 7, 2023 17:32
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

Added some comments

@evantk91 evantk91 requested a review from Ayyanchira December 11, 2023 23:44
Copy link
Member

@Ayyanchira Ayyanchira left a comment

Choose a reason for hiding this comment

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

LGTM

@evantk91 evantk91 merged commit ee7a42d into embedded Dec 12, 2023
4 checks passed
@evantk91 evantk91 deleted the evan/feature/placement-support branch December 12, 2023 01:07
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.

2 participants