Nextcloud-deck: Link for PushNotifications could not be parsed

Created on 17 Oct 2020  路  7Comments  路  Source: stefan-niedermann/nextcloud-deck

The app crashed after switching to another app and the switching back after a while.

To reproduce
Issue is reproducible with an account from try.nextcloud.com:

  • [ ] Yes
  • [ ] No
  • [x] Haven't checked yet.

Steps to reproduce the behavior:

  1. Go to the app
  2. Do some stuff
  3. Switch to another app
  4. Switch back after a while
  5. The app shows that crash backtrace.

I haven't checked yet if it happens consistently, I just got the stack trace and thought it was better to report it now.

Expected behavior

The app resumes the activity correctly.

Screenshots

Versions

  • Nextcloud: 9.0.4
  • Nextcloud Deck: 1.1.2
  • Nextcloud Android: 3.13.1
  • Nextcloud Android Deck: see stack trace

Smartphone (please complete the following information):

  • Device: see stack trace
  • Android-Version: see stack trace
  • App-Store:

    • [ ] Google Play Store

    • [ ] Google Play Store (Beta channel)

    • [x] F-Droid

    • [ ] Huawei AppGallery

Are you using LDAP?

  • [ ] Yes
  • [x] No

Stacktrace

Full Crash:

App Version: 1.11.1
App Version Code: 1011001
App Flavor: fdroid

Files App Version Code: 30130190

---

OS Version: 3.18.120-perf+(1930916292597)
OS API Level: 28
Device: lucye
Manufacturer: LGE
Model (and Product): LG-H870 (lucye_global_com)

---

java.lang.RuntimeException: Unable to resume activity {it.niedermann.nextcloud.deck/it.niedermann.nextcloud.deck.ui.PushNotificationActivity}: java.lang.IllegalArgumentException: this doesn't seem to be an URL containing the board ID
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3947)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3979)
    at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1864)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:205)
    at android.app.ActivityThread.main(ActivityThread.java:6991)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:884)
Caused by: java.lang.IllegalArgumentException: this doesn't seem to be an URL containing the board ID
    at it.niedermann.nextcloud.deck.util.ProjectUtil.extractBoardIdAndCardIdFromUrl(ProjectUtil.java:53)
    at it.niedermann.nextcloud.deck.ui.PushNotificationActivity.onResume(PushNotificationActivity.java:62)
    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1413)
    at android.app.Activity.performResume(Activity.java:7315)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3939)
    ... 11 more

馃悶 bug

All 7 comments

Hey, thanks for the report! Are you able to reproduce this issue or did it only happen one time?

Did you receive and open a push notification and then switched back?

Hey, thanks for the report! Are you able to reproduce this issue or did it only happen one time?

On a simple switch, I can't reproduce it. I'm forcing the resume of the activity by using the debugging option of Android "Don't keep activities", because otherwise I can't predict when my phone will decide to kill the app in the background, but I'm not sure if that could also interfere with the bug.

Did you receive and open a push notification and then switched back?

Sadly I don't remember how I left the app before switching back, but I'm almost sure I didn't open the app via a Nextloud Deck App notification.

@desperateCoder branch: 707-push-notifications

I have added a few unit tests for ProjectUtil#extractBoardIdAndCardIdFromUrl, please try to adjust the extraction magic to match the new unit test setup.

What has changed: The # character in the URL is now optional.

I think @llucax is using an old Deck version, where the URLs didn't contain this character yet. @llucax which version of the Deck server app exactly are you using? I just noticed it was 1.1.2 so this can't be the root cause.

In case it helps in any way, I didn't experience the crash again since I reported it. I update the app frequently though, and I am now at 1.12.1 (updated just today).

Thank you for the feedback - i already updated the error messages that we will get better messages the next time it happens - let us implement this hardening and then close this issue u til it happens again 馃檪

Okay, as discussed:

  • we have build a more robust implementation to avoid those kind of error
  • we have build in more meaningful logging

Both improvements will be shipped with version 1.12.2.

Please continue to report any issues, especially if this error happens again :+1: Thank you for your contribution!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cappuMUC picture cappuMUC  路  3Comments

R4U5CH1337 picture R4U5CH1337  路  3Comments

ahangarha picture ahangarha  路  4Comments

thenickname picture thenickname  路  4Comments

ghost picture ghost  路  3Comments