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

[Logic Improvement] Enable notifications for the first iteration of the scanner when the state is empty #548

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ThomasDelsart
Copy link
Contributor

In this first iteration of the scanner, the self.state variable is initialized as an empty dictionary and only populated after the first notification command is executed. This means that in the initial scan, notifications are not sent for magic bags already available in the TGTG application.

Since the second scan does not detect changes (if no new magic bags are added), no notifications are sent for the already available magic bags.

To address this, I propose a minor logic improvement by initializing the self.state variable before the first notification command is triggered.

Additionally, to pass the pre-commit checks, I ran poetry lock to update dependencies, as poetry lock --no-update was unsuccessful. The app continues to run smoothly with these changes.

@ihor-chaban
Copy link

ihor-chaban commented Dec 9, 2024

I think the current behavior is intended.
The purpose of scanner is to notify you about the changes over time.
In order to see what bags are currently available you can simply open the app at any given moment.
So startup notifications for all currently available bags doesn't seem very useful and, in fact, may be redundant.
This is somewhat similar to the existing test notification but with real data instead.

If you like to merge this feature, I would suggest to add a configuration variable to enable/disable it and to sync it with the existing test notification, as both test notification and real notifications on startup are not needed.
Also it should be possible to not send any notifications on startup.

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

Successfully merging this pull request may close these issues.

2 participants