fix type for notificationIDList in _build_monitor_data() #57

Open
obfusk wants to merge 1 commit from obfusk/fix-type into master
obfusk commented 2023-09-16 23:16:59 +02:00 (Migrated from github.com)

The type here is incorrect. In _build_monitor_data(), the notificationIDList parameter is a list, which then gets converted to a dict in _convert_monitor_input().

The wrong type here doesn't actually affect anything as it is an empty dict and thus never processed in _convert_monitor_input(), as an empty list would have been as well.

    dict_notification_ids = {}
    if kwargs["notificationIDList"]:
        for notification_id in kwargs["notificationIDList"]:
            dict_notification_ids[notification_id] = True
    kwargs["notificationIDList"] = dict_notification_ids

But it's still technically the wrong type in that part of the code, and changing other parts of the code could result in that causing a bug at some point.

NB: I haven't tested this change yet.

The type here is incorrect. In `_build_monitor_data()`, the `notificationIDList` parameter is a `list`, which then gets converted to a `dict` in `_convert_monitor_input()`. The wrong type here doesn't actually affect anything as it is an empty `dict` and thus never processed in `_convert_monitor_input()`, as an empty `list` would have been as well. ```py dict_notification_ids = {} if kwargs["notificationIDList"]: for notification_id in kwargs["notificationIDList"]: dict_notification_ids[notification_id] = True kwargs["notificationIDList"] = dict_notification_ids ``` But it's still technically the wrong type in that part of the code, and changing other parts of the code could result in that causing a bug at some point. NB: I haven't tested this change yet.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin obfusk/fix-type:obfusk/fix-type
git checkout obfusk/fix-type

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout master
git merge --no-ff obfusk/fix-type
git checkout obfusk/fix-type
git rebase master
git checkout master
git merge --ff-only obfusk/fix-type
git checkout obfusk/fix-type
git rebase master
git checkout master
git merge --no-ff obfusk/fix-type
git checkout master
git merge --squash obfusk/fix-type
git checkout master
git merge --ff-only obfusk/fix-type
git checkout master
git merge obfusk/fix-type
git push origin master
Sign in to join this conversation.
No description provided.