nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.26k stars 1.76k forks source link

Note for public Share -- too Long? #6862

Closed weinic closed 4 years ago

weinic commented 4 years ago

I think my Note for the Public Share is too long

**** CAUSE OF ERROR ****

java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable com.google.android.material.textfield.TextInputEditText.getText()' on a null object reference at com.owncloud.android.ui.dialog.NoteDialogFragment.onClick(NoteDialogFragment.java:141) at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7697) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

**** APP INFORMATION **** ID: com.nextcloud.client Version: 30130090 Build flavor: gplay

**** DEVICE INFORMATION **** Brand: OnePlus Device: OnePlus5 Model: ONEPLUS A5000 Id: QKQ1.191014.012 Product: OnePlus5

**** FIRMWARE **** SDK: 29 Release: 10 Incremental: 2006012143

tobiasKaminsky commented 4 years ago

How long is your note?

stale[bot] commented 4 years ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

weinic commented 4 years ago

Hello, this is the Note

Hallo liebe Hochzeitsgäste, --- --- wir würden euch bitten die Bilder und Videos die Ihr gemacht habt hier mit uns zu teilen, damit wir auch an diesen unsere Freude haben können 😃. --- --- Wir wünschen euch noch viel Spaß auf unserer Hochzeit 💒👰🤵 👨‍👩‍👧 --- --- Petra & Christoph mit Katharina - - - - - - - - - - - PS: Hier der Link zu den Bildern vom Fotoautomat 📸 --- --- http://testlink.testlink.testlink

Is this Note to long for the Nextcloud App?

tobiasKaminsky commented 4 years ago

First, congratulations to your wedding!

Let me try it :-)

tobiasKaminsky commented 4 years ago

Is this Note to long for the Nextcloud App?

For me it was truncated at "Petra". But it did not crashed…

@nextcloud/server-triage do we have a limit on notes?

weinic commented 4 years ago

I Test it 3 days ago. For me is the same, the App dont crasht, but the Text also truncated at "Petra"

Maybe something in the program code has changed so that the app no ​​longer crashes because I've already updated the app since then.

blizzz commented 4 years ago

at least in the database oc_share.note is not limited. not sure about the biz logic.

tobiasKaminsky commented 4 years ago

Notes are updated on share by sending them to /ocs/v2.php/apps/files_sharing/api/v1/shares as request entitty, .eg. note=123 Can it be that this is limited?

kesselb commented 4 years ago

I created a public share on https://try.nextcloud.com and set the note via web. That worked and is using the same api as the android app. Maybe @weinic could clarify if this is happening only with the android app or web as well.

weinic commented 4 years ago

@kesselb it is only with the Andoid App. In the web it is no Problem.

tobiasKaminsky commented 4 years ago

@kesselb can you point me to the web code how the note is updated? As stated above we add this as request entity note=123 and this might be limited?

nickvergessen commented 4 years ago

https://github.com/nextcloud/server/blob/89f7e2ab6409ef034ab6d4ce73f45517ae4f5d3f/apps/files_sharing/lib/Controller/ShareAPIController.php#L1011-L1013 Database wise the column is text (not string) and therefor should allow up to 65k I think

tobiasKaminsky commented 4 years ago

Found the problem. It is about "&", which was not escaped correcty… Fix will be in android-library.

tobiasKaminsky commented 4 years ago

https://github.com/nextcloud/android-library/pull/522