Skip to content

Conversation

@tobiasKaminsky
Copy link
Member

@tobiasKaminsky tobiasKaminsky commented May 7, 2019

TODO

  • test silent push notification on older version: how is this handled?

If a notification is now dismissed, the server sends a silent push notification to all devices and removes the notification in status bar.

This will be in NC17 on server side, but can already merged as this then just does nothing…
Ref: nextcloud/server#15040, nextcloud/notifications#318

Signed-off-by: tobiasKaminsky [email protected]

} else if (decryptedPushMessage.deleteAll) {
notificationManager.cancelAll();
} else if (!APP_SPREED.equals(decryptedPushMessage.getApp())) {
// We ignore Spreed messages for now
Copy link
Member

Choose a reason for hiding this comment

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

Please don't!

The server app is cleverly enough. You only get them when there is no Talk app installed for the user. In this case a "linking to the web" notification in the files app is better than nothing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm. This is code done by Mario.
I did not touched it.
I'll test what happens when I remove it.

@tobiasKaminsky
Copy link
Member Author

2019-05-07-135540

This is what I do get if I do not have Talk app installed.

@nickvergessen
Copy link
Member

Jep, thats the expected result

@nextcloud nextcloud deleted a comment May 7, 2019
@nextcloud nextcloud deleted a comment May 7, 2019
@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #3969 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master   #3969      +/-   ##
===========================================
- Coverage      6.58%   6.57%   -0.01%     
  Complexity        1       1              
===========================================
  Files           322     322              
  Lines         30908   30928      +20     
  Branches       4408    4410       +2     
===========================================
- Hits           2036    2035       -1     
- Misses        28576   28597      +21     
  Partials        296     296
Impacted Files Coverage Δ Complexity Δ
...ncloud/android/datamodel/DecryptedPushMessage.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ava/com/owncloud/android/jobs/NotificationJob.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ncloud/android/authentication/PassCodeManager.java 13.72% <0%> (-2.19%) 0% <0%> (ø)
.../third_parties/daveKoeller/AlphanumComparator.java 80.95% <0%> (-1.2%) 0% <0%> (ø)
.../android/authentication/AuthenticatorActivity.java 1.88% <0%> (-0.01%) 0% <0%> (ø)
...owncloud/android/ui/activity/PassCodeActivity.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...droid/ui/fragment/OCFileListBottomSheetDialog.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...cloud/android/ui/activity/FileDisplayActivity.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...ndroid/ui/activity/RequestCredentialsActivity.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...m/owncloud/android/ui/activity/DrawerActivity.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
... and 2 more

@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #3969 into master will decrease coverage by 0.05%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##             master   #3969      +/-   ##
===========================================
- Coverage     14.35%   14.3%   -0.06%     
  Complexity        1       1              
===========================================
  Files           329     329              
  Lines         31017   31023       +6     
  Branches       4427    4428       +1     
===========================================
- Hits           4453    4438      -15     
- Misses        25777   25801      +24     
+ Partials        787     784       -3
Impacted Files Coverage Δ Complexity Δ
...ncloud/android/datamodel/DecryptedPushMessage.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...ava/com/owncloud/android/jobs/NotificationJob.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...owncloud/android/ui/adapter/DiskLruImageCache.java 31.16% <0%> (-7.8%) 0% <0%> (ø)
.../owncloud/android/ui/activity/ToolbarActivity.java 56.52% <0%> (-2.9%) 0% <0%> (ø)
.../third_parties/daveKoeller/AlphanumComparator.java 80.95% <0%> (-1.2%) 0% <0%> (ø)
...loud/android/datamodel/ThumbnailsCacheManager.java 33.39% <0%> (-0.93%) 0% <0%> (ø)
...cloud/android/ui/activity/FileDisplayActivity.java 19.29% <0%> (-0.09%) 0% <0%> (ø)
...owncloud/android/ui/adapter/OCFileListAdapter.java 28.27% <0%> (ø) 0% <0%> (ø) ⬇️

@AndyScherzinger
Copy link
Member

Rebase might help with spot bugs?

@AndyScherzinger
Copy link
Member

Nope,increased scoring...

@tobiasKaminsky
Copy link
Member Author


Method com.owncloud.android.datamodel.DecryptedPushMessage$$Parcelable.write(DecryptedPushMessage, Parcel, int, IdentityCollection) excessively uses methods of another class
--
  | Bug type CE_CLASS_ENVY (click for details) In class com.owncloud.android.datamodel.DecryptedPushMessage$$ParcelableIn method com.owncloud.android.datamodel.DecryptedPushMessage$$Parcelable.write(DecryptedPushMessage, Parcel, int, IdentityCollection)At DecryptedPushMessage$$Parcelable.java:[lines 48-61]Value com.owncloud.android.datamodel.DecryptedPushMessage



This is the reason. But this is because Parceler, so we cannot do much here.
Except of fiddling around with spotbugs to hide these false alarms.

@nextcloud nextcloud deleted a comment May 13, 2019
@nextcloud-android-bot
Copy link
Collaborator

@AndyScherzinger
Copy link
Member

This is the reason. But this is because Parceler, so we cannot do much here.
Except of fiddling around with spotbugs to hide these false alarms.

@tobiasKaminsky filter didn't seem to work. So raise the score? (I guess)

@AndyScherzinger
Copy link
Member

@tobiasKaminsky spotbugs filter change doesn't seem to work...

@tobiasKaminsky
Copy link
Member Author

@tobiasKaminsky spotbugs filter change doesn't seem to work...

Yes, I am on it, but somehow all regex I am trying just do not work… :/

@AndyScherzinger
Copy link
Member

not a regex pro but shouldn't ~.*?Parcelable.* work?

do not ignore talk messages (will only be sent if no talk app is installed)
exclude generated Parcelable

Signed-off-by: tobiasKaminsky <[email protected]>
@tobiasKaminsky
Copy link
Member Author

Finally I hope I got it.
But I do not get why "~" is needed:

Escaping $ is ok
.* is also needed, as this just means any or zero character
but ~ is included in "."…

@nextcloud nextcloud deleted a comment May 23, 2019
@nextcloud nextcloud deleted a comment May 23, 2019
@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/9405.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

297

Lint

TypemasterPR
Warnings5858
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings25
Correctness Warnings68
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings122
Security Warnings47
Dodgy code Warnings137
Total424

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings25
Correctness Warnings74
Internationalization Warnings12
Malicious code vulnerability Warnings4
Multithreaded correctness Warnings9
Performance Warnings122
Security Warnings47
Dodgy code Warnings141
Total434

@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.7.0 milestone May 23, 2019
@AndyScherzinger AndyScherzinger merged commit 3b31841 into master May 23, 2019
@AndyScherzinger AndyScherzinger deleted the receivePushDelete branch May 23, 2019 12:37
tobiasKaminsky added a commit that referenced this pull request May 24, 2019
3b31841 Merge pull request #3969 from nextcloud/receivePushDelete
6074c93 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
f28007e OCFileListFragment: Only scroll to top if directory changed (#4058)
b061e4d Merge commit '51ee4d88fd0555a945a24b1ab3beba2ffdc79c06'
51ee4d8 handle silent delete/delete-all push notifications do not ignore talk messages (will only be sent if no talk app is installed) exclude generated Parcelable
fb6b11f Use product name on rich document, if available (#3971)
4197d3b use proper qa build lib dependency
8c06097 Only compare directories if necessary
403a3e0 Use product name on rich document, if available use placeholder for string reset to master-snapshot fix analysis warning use new translatable string use var vor qa flavor too
9b0a789 Merge pull request #4040 from nextcloud/ezaquarii/remove-findbugs
d6b4dee Remove legacy FindBugs tasks from build script
53c9c05 daily dev 20190523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants