Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid addon output not handled properly #2632

Open
madduck opened this issue May 8, 2024 · 0 comments
Open

Invalid addon output not handled properly #2632

madduck opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working or in unexpected ways joex affects the joex component

Comments

@madduck
Copy link
Contributor

madduck commented May 8, 2024

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.

@eikek eikek added bug Something isn't working or in unexpected ways joex affects the joex component labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or in unexpected ways joex affects the joex component
Projects
None yet
Development

No branches or pull requests

2 participants