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: implement dismissed events bucket #587

Merged
merged 5 commits into from
Dec 14, 2023

Conversation

tymmesyde
Copy link
Member

No description provided.

@tymmesyde tymmesyde requested a review from elpiel December 13, 2023 11:38
src/runtime/msg/action.rs Outdated Show resolved Hide resolved
Comment on lines 83 to 95
Some(GetNotificationResponse { id, .. })
if !dismissed_events.items.contains_key(id) =>
{
eq_update(
&mut events.notification,
Loadable::Ready(response.to_owned()),
)
}
_ => eq_update(
&mut events.notification,
Loadable::Ready(response.to_owned()),
),
},
Copy link
Member

Choose a reason for hiding this comment

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

  • case that is not handled: Event that's dismissed should not result to Loadable::Ready

Copy link
Member Author

Choose a reason for hiding this comment

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

The request was successful so it's Ready, not loading, not an error
If it was dismissed, it returns None

Copy link
Member

@elpiel elpiel left a comment

Choose a reason for hiding this comment

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

How often we will call the GetEvents? We might need to add a timeout for making the requests e.g. every 6 or 12 hours at most.

Some(GetModalResponse { id, .. }) if !dismissed_events.items.contains_key(id) => {
eq_update(&mut events.modal, Loadable::Ready(response.to_owned()))
}
_ => eq_update(&mut events.modal, Loadable::Ready(response.to_owned())),
Copy link
Member

Choose a reason for hiding this comment

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

Same for this match. Both match arms are equal and we need to handle the case where we have dismissed the Modal

  • fix match

Copy link
Member Author

Choose a reason for hiding this comment

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

Check the test, if the modal was dismissed, events.modal will be Loadable:Ready(None)

Copy link
Member Author

Choose a reason for hiding this comment

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

I can put explicitly Loadable::Ready(None) if you prefer

Copy link
Member Author

Choose a reason for hiding this comment

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

No you are absolutely right, will fix that

@tymmesyde tymmesyde merged commit f451b2c into development Dec 14, 2023
1 check passed
@unclekingpin unclekingpin self-requested a review December 14, 2023 21:29
Copy link
Contributor

@unclekingpin unclekingpin left a comment

Choose a reason for hiding this comment

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

looks great

@elpiel elpiel deleted the feat/dismissed-events-bucket branch January 24, 2024 09:43
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.

3 participants