Raudius / files_scripts

Custom file actions app for Nextcloud
GNU Affero General Public License v3.0
28 stars 13 forks source link

Better convey function "notify" constrains #175

Open EnriqSSSS opened 2 months ago

EnriqSSSS commented 2 months ago

Hello, i recently began to use this plugin on nextcloud to automate somethings.

I was having some issues involving the notify function. After some time of debugging i figured out that both the subject and message field of the notify function have a hard limit of character in 64.

This isn't a bug or anything, I just think that would neat to have this info on the docs

Raudius commented 2 months ago

Hi Enriq,

Thanks a lot for the suggestion.

I am curious, what was the behaviour when creating a notification with a long subject/message?

Regarding the docs, because a lot of the functionality of this app is basically just forwarding requests to Nextcloud's server API, many limits and constraints are not actually controlled by the app itself. Similarly the values themselves are of course subject to change outside of the scope of this project as well.
What I would prefer to do is to link to relevant documentation from Nextcloud themselves, but in this case even Nextcloud's own documentation is lacking.

EnriqSSSS commented 2 months ago

Basically both the subject and the message parameters on the notify function have a 64 characters size limit (including '\0').

Which means that if you are trying to let's say: Send the name of a file in a notification, most of the time would work, but in the edge cases where the file name has more than 64, them the function wouldn't work, without any warning or errors.

And yes, i noticed that this is just the default behaviour on nextcloud API. Something similar happened with this guy with onlyoffice plugin:

Https://github.com/ONLYOFFICE/onlyoffice-nextcloud/issues/732

And you are right nextcloud documentation also isn't that great.

Raudius commented 2 months ago

Cool, I will make sure to include a note in the docs of that function for a future release.

Maybe I'll try digging upstream on Nextcloud's repo to see if there is a reason for this limit or if it can be relaxed.