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

feat: Compute snooze state in thread #2218

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LunarX
Copy link
Contributor

@LunarX LunarX commented Mar 5, 2025

This PR simply computes the snooze state at the thread level and can directly be merged inside master as it's not even visible to the user

@LunarX LunarX added the enhancement Improve or expand upon an existing feature label Mar 5, 2025
@LunarX LunarX requested a review from KevinBoulongne March 5, 2025 14:17
@LunarX LunarX self-assigned this Mar 5, 2025
Copy link

sonarqubecloud bot commented Mar 5, 2025

Comment on lines +23 to +25
Snoozed(apiValue = "snoozed"),
Unsnoozed(apiValue = "unsnoozed"),
WasSnoozed(apiValue = "was_snoozed"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add some short comment explaining what each state represents exactly.

}

private fun updateThread() {

fun Thread.updateSnoozeSatesBasedOn(message: Message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fun Thread.updateSnoozeSatesBasedOn(message: Message) {
fun Thread.updateSnoozeStateBasedOn(message: Message) {

Comment on lines +236 to 238
duplicates.forEach { duplicate ->
updateSnoozeSatesBasedOn(duplicate)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
duplicates.forEach { duplicate ->
updateSnoozeSatesBasedOn(duplicate)
}
duplicates.forEach(::updateSnoozeSatesBasedOn)

Comment on lines +236 to 238
duplicates.forEach { duplicate ->
updateSnoozeSatesBasedOn(duplicate)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need/want to update the Thread based on the duplicated Messages ? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve or expand upon an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants