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

Unverified sessions alert #7056

Merged
merged 4 commits into from
Nov 10, 2022

Conversation

paleksandrs
Copy link
Contributor

@paleksandrs paleksandrs commented Nov 9, 2022

Closses #7043

Change current unverified sessions alert using following ACs:

  • A dedicated build setting / equivalent exists that allows to toggle the alerts on / off
  • The default value of the build setting is on
  • The alert reuses the existing UX
  • The alert title is “You have unverified sessions”
  • The alert body is “Review to ensure your account is safe.”
  • The alert contains two options: “Review” and “Later”
    • “Review” takes the user to the currently active device manager (when the flag is OFF the current one, when it is ON the new one).
    • “Later” snoozes the alert for one week. The delay is stored per device and not synced across all devices in the account.
    • The existing "Do not ask again" from iOS is removed. It's only shown on that platform and can't be reverted intuitively (sign out and sign in).
  • The alert is displayed after:
    • logging in to a new session and fully verifying that session
    • opening the app (regardless of whether it’s from the background or a cold launch)
  • The alert is displayed only when:
    • there is at least one unverified session
    • and the current session itself is not verified
    • and the user is not within a snooze period
    • and the build setting is enabled
  • On sign out clear snooze delay

Screenshot 2022-11-09 at 15 19 38

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@paleksandrs paleksandrs marked this pull request as ready for review November 9, 2022 13:21
@paleksandrs paleksandrs requested review from a team and phloux and removed request for a team November 9, 2022 13:22
@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Base: 11.78% // Head: 11.81% // Increases project coverage by +0.03% 🎉

Coverage data is based on head (77b2385) compared to base (3c2b4a3).
Patch coverage: 46.93% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7056      +/-   ##
===========================================
+ Coverage    11.78%   11.81%   +0.03%     
===========================================
  Files         1611     1615       +4     
  Lines       158184   158427     +243     
  Branches     64245    64369     +124     
===========================================
+ Hits         18640    18726      +86     
- Misses      138914   139063     +149     
- Partials       630      638       +8     
Flag Coverage Δ
uitests 54.59% <ø> (-0.04%) ⬇️
unittests 6.09% <46.93%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Config/BuildSettings.swift 43.07% <ø> (ø)
Riot/Managers/Settings/RiotSettings.swift 88.33% <ø> (ø)
Riot/Modules/Room/RoomViewController.m 0.00% <0.00%> (ø)
Riot/Modules/TabBar/MasterTabBarController.m 0.00% <0.00%> (ø)
...Modules/Home/AllChats/AllChatsViewController.swift 28.93% <4.76%> (+0.15%) ⬆️
Riot/Modules/Application/LegacyAppDelegate.m 14.46% <50.00%> (+0.15%) ⬆️
Riot/Categories/Date+Calculation.swift 75.00% <75.00%> (ø)
.../AllChats/ReviewSessionAlertSnoozeController.swift 100.00% <100.00%> (ø)
...es/Room/Composer/ViewModel/ComposerViewModel.swift 40.00% <0.00%> (-8.28%) ⬇️
...tSwiftUI/Modules/Room/Composer/View/Composer.swift 84.75% <0.00%> (-3.68%) ⬇️
... and 48 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@phloux phloux left a comment

Choose a reason for hiding this comment

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

I just have 2 small comments/questions about the init of ReviewSessionAlertSnoozeController.

self.init(userDefaults: UserDefaults.standard)
}

init(userDefaults: UserDefaults = UserDefaults.standard) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add the userDefaults parameter ? It seems to be not used at this time (otherwise than in the previous convenience init in this file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is being used in unit tests to inject userdefaults

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I hadn't the Unit Tests in mind. It's ok for me 🙂

@objcMembers
class ReviewSessionAlertSnoozeController: NSObject {

private let userDefaults: UserDefaults
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the 2 following init methods will be useless if you instantiate userDefaults value right here.

Copy link
Contributor

@phloux phloux left a comment

Choose a reason for hiding this comment

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

LGTM

@paleksandrs paleksandrs merged commit 3dd03a1 into develop Nov 10, 2022
@paleksandrs paleksandrs deleted the aleksandrs/7043_unverified_sessions_alert branch November 10, 2022 07:23
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