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

Fix NoSuchElementException in notification content plugin #2828

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

aitorvs
Copy link
Collaborator

@aitorvs aitorvs commented Feb 8, 2023

Task/Issue URL: https://app.asana.com/0/488551667048375/1203928902312895/f

Description

See asana task for description

Steps to test this PR

AppTP Notifications

  • fresh install from this branch
  • launch app and enable AppTP
  • verify ongoing notification shows and text is Scanning for tracking activity… beep… boop
  • open any one app that tracks
  • verify ongoing notification shows and text is Tracking attempts blocked in 1 app (past hour).
  • open any second app that tracks
  • verify ongoing notification shows and text is Tracking attempts blocked across 2 apps (past hour).
  • Force close the app
  • notification should disappear
  • re-open app
  • verify ongoing notification shows and text is Tracking attempts blocked across 2 apps (past hour).
  • verify tapping on the notification takes the user to AppTP screen

@aitorvs
Copy link
Collaborator Author

aitorvs commented Feb 8, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

fun PluginPoint<VpnEnabledNotificationContentPlugin>.getHighestPriorityPlugin(): VpnEnabledNotificationContentPlugin {
return getPlugins().filter { it.isActive() }.maxBy { it.getPriority().ordinal }
fun PluginPoint<VpnEnabledNotificationContentPlugin>.getHighestPriorityPlugin(): VpnEnabledNotificationContentPlugin? {
return runCatching { getPlugins().filter { it.isActive() }.maxByOrNull { it.getPriority().ordinal } }.getOrNull()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to wrap this in runCatching? We can also add tests here to check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just saw the explanation in Asana. 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice, added tests

Copy link
Contributor

@karlenDimla karlenDimla left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@aitorvs aitorvs force-pushed the fix/aitor/atp/notification_content_plugin branch 2 times, most recently from 805dadb to 412eb62 Compare February 9, 2023 10:34
@aitorvs aitorvs force-pushed the fix/aitor/atp/notification_content_plugin branch from 412eb62 to 30a9439 Compare February 9, 2023 10:48
@aitorvs aitorvs merged commit f28668a into develop Feb 9, 2023
@aitorvs aitorvs deleted the fix/aitor/atp/notification_content_plugin branch February 9, 2023 11:07
malmstein pushed a commit that referenced this pull request Feb 9, 2023
Task/Issue URL: https://app.asana.com/0/488551667048375/1203928902312895/f

### Description
See [asana task](https://app.asana.com/0/488551667048375/1203928902312895/f) for description

### Steps to test this PR
_AppTP Notifications_
- [x] fresh install from this branch
- [x] launch app and enable AppTP
- [x] verify ongoing notification shows and text is `Scanning for tracking activity… beep… boop`
- [x] open any one app that tracks
- [x] verify ongoing notification shows and text is `Tracking attempts blocked in 1 app (past hour).`
- [x] open any second app that tracks
- [x] verify ongoing notification shows and text is `Tracking attempts blocked across 2 apps (past hour).`
- [x] Force close the app
- [x] notification should disappear
- [x] re-open app
- [x] verify ongoing notification shows and text is `Tracking attempts blocked across 2 apps (past hour).`
- [x] verify tapping on the notification takes the user to AppTP screen
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