OpenTermsArchive / engine

Tracks contractual documents and exposes changes to the terms of online services.
https://opentermsarchive.org
European Union Public License 1.2
105 stars 29 forks source link

Engine Stales with non-existing service ID #1042

Closed jetlime closed 4 months ago

jetlime commented 6 months ago

The tracking of an non-existing service ID stales. Instead of a warning it shall return an appropriate error and exit. Since the program continues to run indefinitely, it can be confusing for new users and problematic for automated CI runs.

Observed Behavior:

$ npx ota track -X
2024-01-05 20:23:13 info                                                                              Start Open Terms Archive
2024-01-05 20:23:13 warn                                                                              Parameter "X" was interpreted as a service ID to update, but no matching declaration was found; it will be ignored
2024-01-05 20:23:13 info                                                                              Examining 0 terms from 0 services for extraction…

Desired Behavior:

$ npx ota track -X
2024-01-05 20:23:13 info                                                                              Start Open Terms Archive
2024-01-05 20:23:13 error                                                                              Parameter "X" was interpreted as a service ID to update, but no matching declaration was found.
$
Ndpnt commented 5 months ago

Hi @jetlime and thanks for providing your feedback.

Exiting instead of just warning could be discussed, but you're right, the engine shouldn't keep running indefinitely in this case and we can consider this as a bug.

MattiSG commented 4 months ago

Thanks @jetlime for reporting! Thanks to @Ndpnt and @clementbiron this has been fixed in v0.34.3, and the engine will now simply ignore any specified services that do not match any tracked ones. We decided to ignore rather than to exit to ensure backwards compatibility that supported scripted behavior.

We hope this change improves your experience with Open Terms Archive! 😊