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

Token "restock" not valid in system-wide notification settings after updating #2880

Open
rcostanza opened this issue Jan 3, 2025 · 3 comments
Assignees
Labels

Comments

@rcostanza
Copy link

Describe the bug
After updating from a couple months old version (sorry, can't remember which), trying to save system-wide notification settings while either notification title or body uses the token restock prevents from saving settings while also showing the error message below:

The following tokens used in the notification are not valid: restock

If using a restock property directly without checking if restock exists, for example a message composed of just {{ restock.price }}, the error is:

A variable or function is not defined: 'restock' is undefined

When editing settings for a specific watch of type "Re-stock & Price detection", the token is accepted.

Version
v0.48.05

How did you install?
Docker

To Reproduce

  1. Go to settings > notifications
  2. Write the example value below In the notification body field:
    • {% if restock %}From $ {{restock.original_price}} to $ {{restock.price}}{% else %}{{diff}}{% endif %}
  3. Save
  4. An error occurs and the settings aren't saved

Expected behavior
Token should be accepted and settings should be saved, as it worked a few versions ago.

@dgtlmoon
Copy link
Owner

dgtlmoon commented Jan 5, 2025

thanks! any idea what version from ?

In all new versions that should be a valid token

{{restock.price}}	Price detected
{{restock.original_price}}	Original price at first check

@rcostanza
Copy link
Author

I'm not sure, but probably 0.47.03.

@rcostanza
Copy link
Author

I reverted all the way to 0.45.13 (jan 2024) and I still get the error, so it's not due to updating to a newer version.

Debugging it a bit more, turns out the token restock is only accepted by the system-wide notification settings if you have at least one watch of type "Re-stock & Price detection".

Turns out, the reason I managed to have that notification body saved even though I can't save it anymore, is because I used to have a watch of that type but deleted afterwards.

I don't know if this is expected behavior so I won't close the issue, but feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants