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 interface persistence #2856

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

hmalik88
Copy link
Contributor

Implementing interface persistence based on a new property stored in the interface object called contentType, it is used to indicate whether the SnapInterfaceController should persist the interface. The property is added at various points in our system where an interface is created.

@hmalik88 hmalik88 requested a review from a team as a code owner October 23, 2024 04:18
@hmalik88 hmalik88 marked this pull request as draft October 23, 2024 04:19
@hmalik88 hmalik88 marked this pull request as ready for review October 23, 2024 18:50
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.

Project coverage is 94.44%. Comparing base (90b8e43) to head (c130124).

Files with missing lines Patch % Lines
...ntrollers/src/interface/SnapInterfaceController.ts 80.76% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2856      +/-   ##
==========================================
- Coverage   94.47%   94.44%   -0.04%     
==========================================
  Files         486      486              
  Lines       10368    10398      +30     
  Branches     1582     1591       +9     
==========================================
+ Hits         9795     9820      +25     
- Misses        573      578       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -132,7 +140,22 @@ export class SnapInterfaceController extends BaseController<
super({
messenger,
metadata: {
interfaces: { persist: false, anonymous: false },
interfaces: {
persist: (interfaces: Record<string, StoredInterface>) => {
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we should have any limits on this? How long do we persist Snap notifications for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is mainly to cover the edge case where the interface is lost for the detailed view notification across sessions. I realize it would persist an unread notification's interface indefinitely if the user never reads it, but that's an extreme edge case. I've started conversation with the notification team about exposing some settings to the user to control the lifecycle of notifications.

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