files_scripts icon indicating copy to clipboard operation
files_scripts copied to clipboard

Better convey function "notify" constrains

Open EnriqSSSS opened this issue 1 year ago • 3 comments

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

EnriqSSSS avatar Jul 15 '24 14:07 EnriqSSSS

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.

Raudius avatar Jul 15 '24 16:07 Raudius

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.

EnriqSSSS avatar Jul 16 '24 13:07 EnriqSSSS

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.

Raudius avatar Jul 16 '24 13:07 Raudius