Invalid addon output not handled properly
- Dominant language
- Elm
- Stars
- 2.3k
- Forks
- 184
- Avg merge
- 8h 2m
- Merged PRs (30d)
- 4
Description
Custom field values are limited to 1,000 characters (which doesn't seem to be documented anywhere). If an addon tries to add a custom field value that exceeds this limit, then subsequent commands will get ignored.
For instance, consider the following JSON:
```
[
{
"itemId": "DsPv9R5DC3r-LrkAjJ7LT1E-mDcu5rjKo5B-FqY8LaRVu1g",
"actions": [
{
"date": 1386154800000,
"action": "set-date"
},
{
"field": "custom",
"value": "a value with more than … 1000 characters",
"action": "set-field"
},
{
"name": "vStadtentwässerung Genehmigungsbescheid",
"action": "set-name"
}
],
"command": "item-update"
}
]
```
This will cause Docspell to set the due date, but then it fails to update the custom field due to the value being longer than 1,000. Processing then stops, and the item name is also not update.
I think that the code should either truncate the value (and output a warning) and continue with the rest of the updates, or — better — fail the addon run entirely.
Contributor guide
Assessment
This issue has not been assessed yet.