Skip to content

Conversation

@dbrant
Copy link
Collaborator

@dbrant dbrant commented Sep 26, 2018

The notification channel needs to be created for API versions greater than OR EQUAL to 26 (O). Also, the channel does not need to be reinitialized if it already exists.
This will likely fix #1877

The notification channel needs to be created for API versions greater than
OR EQUAL to 26 (O).  Also, the channel does not need to be reinitialized
if it already exists.
@dbrant
Copy link
Collaborator Author

dbrant commented Sep 26, 2018

I've recreated the PR on top of master. I'm afraid I don't know how to properly rebase it onto the 2.8 branch... (the 2.8 branch seems to be quite a bit behind, and excludes our library/dex updates, as well as all the other crash fixes)

@misaochan
Copy link
Member

misaochan commented Sep 26, 2018

Hmmm... I tested this anyway, and it still has the same crash. :( Does it work for you in prodRelease?

09-27 03:25:00.753 26949-26949/fr.free.nrw.commons E/AndroidRuntime: FATAL EXCEPTION: main
    Process: fr.free.nrw.commons, PID: 26949
    android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=CommonsNotificationAll pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x52 color=0x00000000 vis=PRIVATE)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Aside from that, I think it's OK to leave this PR up. When it works, I can always just merge, then cherry-pick onto 2.8-release and re-test there. :)

Sorry, yeah, 2.8-release is a bit behind master. Unfortunately, our test coverage is currently abysmal (soon to be improved hopefully!), so @neslihanturan and I do a lot of manual testing prior to every major release. We have a lot of new features in master, including PRs from first-time contributors, and typically there is a lot of ironing-out of bugs prior to a major release.... so that's why we try to do all hotfixes as a minor release instead of bundling them with the new features.

@dbrant
Copy link
Collaborator Author

dbrant commented Sep 26, 2018

And... done!

@codecov-io
Copy link

Codecov Report

Merging #1906 into master will increase coverage by 0.01%.
The diff coverage is 11.11%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1906      +/-   ##
=========================================
+ Coverage    3.69%   3.71%   +0.01%     
=========================================
  Files         192     192              
  Lines        9912    9915       +3     
  Branches      886     886              
=========================================
+ Hits          366     368       +2     
- Misses       9519    9520       +1     
  Partials       27      27
Impacted Files Coverage Δ
...java/fr/free/nrw/commons/upload/UploadService.java 0% <0%> (ø) ⬆️
...n/java/fr/free/nrw/commons/CommonsApplication.java 31.25% <12.5%> (+2.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b7c72e...a003d20. Read the comment docs.

@misaochan
Copy link
Member

Works for me now, thanks so much @dbrant ! :) It spams my emulator logcat with errors during uploading, but I think it doesn't show up for the user, so we can just go with this, and I'll make a note for future enhancements.

09-28 01:11:23.173 1615-1615/system_process E/NotificationService: Muting recently noisy 0|fr.free.nrw.commons|1|null|10080
09-28 01:11:23.212 1615-1630/system_process E/NotificationService: Package enqueue rate is 5.8415937. Shedding 0|fr.free.nrw.commons|1|null|10080. package=fr.free.nrw.commons

@misaochan misaochan merged commit e0a79f8 into commons-app:master Sep 27, 2018
misaochan pushed a commit that referenced this pull request Sep 27, 2018
Cherry-pick #1906 onto release branch
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.

android.app.RemoteServiceException crash reports on Play Store

3 participants