Skip to content

Conversation

@djs0109
Copy link
Collaborator

@djs0109 djs0109 commented Oct 15, 2025

closes #259

@djs0109 djs0109 linked an issue Oct 15, 2025 that may be closed by this pull request
@djs0109
Copy link
Collaborator Author

djs0109 commented Oct 15, 2025

Still wait for the next release of FiLiP

@djs0109 djs0109 added the on hold Not prioritised label Oct 15, 2025
@djs0109 djs0109 removed the on hold Not prioritised label Oct 29, 2025
@djs0109 djs0109 requested review from Copilot and sbanoeon October 29, 2025 13:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the filip library from version 0.6.1 to 0.7.3 and adapts the code to handle invalid devices returned by the updated API. The changes include updating the dependency, handling device list objects with separate valid and invalid device collections, and code formatting improvements.

Key changes:

  • Upgraded filip library from ~0.6.1 to ~0.7.3
  • Modified device retrieval to handle invalid devices and display warnings to users
  • Applied code formatting improvements across multiple functions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
app/Entirety/requirements.txt Updated filip dependency from 0.6.1 to 0.7.3
app/Entirety/devices/views/devices.py Added handling for invalid devices with user warnings and logging
app/Entirety/devices/utils.py Updated get_devices to use include_invalid parameter and return device_list object; applied code formatting fixes
Comments suppressed due to low confidence (1)

app/Entirety/devices/utils.py:57

  • The docstring still states 'Returns: list of devices' but the function now returns a device_list object with .devices and .invalid_devices attributes. Update the docstring to reflect the actual return type.
    Returns:
        list of devices

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 67 to 71
device_list = iota_client.get_device_list(include_invalid=True)
return device_list

except RuntimeError:
return [{}]
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception handler returns [{}] (a list), but the normal code path now returns device_list (an object with .devices and .invalid_devices attributes). This type mismatch will cause an AttributeError in devices/views/devices.py when trying to access device_list.devices and device_list.invalid_devices if an exception occurs. The exception handler should return an object with the same structure or be updated to handle the error differently.

Copilot uses AI. Check for mistakes.
@djs0109 djs0109 requested a review from sbanoeon November 14, 2025 09:56
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.

Error handling when devices not passing the validation

3 participants