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

Merged
merged 34 commits into from
Nov 11, 2024
Merged

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

All modified and coverable lines are covered by tests ✅

Project coverage is 94.48%. Comparing base (87234d3) to head (079b627).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2856      +/-   ##
==========================================
+ Coverage   94.47%   94.48%   +0.01%     
==========================================
  Files         486      486              
  Lines       10368    10398      +30     
  Branches     1582     1591       +9     
==========================================
+ Hits         9795     9825      +30     
  Misses        573      573              

☔ 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.

@hmalik88 hmalik88 merged commit c2651ab into main Nov 11, 2024
166 checks passed
@hmalik88 hmalik88 deleted the hm/implement-interface-persistence branch November 11, 2024 17:04
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