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

[CRIMAP-687] evidence download failure logging #447

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

hiboabd
Copy link
Contributor

@hiboabd hiboabd commented Oct 31, 2023

Description of change

Follows PR in apply to add logging around evidence upload failures. The logs capture user id, ip address, severity (error), file type and s3 object key information.

Also adds some error handling to display a message to the user if a download attempt failed. This follows an existing pattern for failures around evidence deletion currently implemented in apply. A screenshot is attached below.

Link to relevant ticket

CRIMAP-687

Notes for reviewer

Note: There is logging already in place in the datastore handling errors with calls to obtain the presign download url. By adding logging on review, we can collect additional information we are interested in e.g. who is attempting to download that wouldn't be available to us in the datastore.

Screenshots of changes (if applicable)

Before changes:

After changes:

Screenshot 2023-10-31 at 13 11 14

How to manually test the feature

@@ -29,7 +29,7 @@
config.cache_store = :null_store

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = true
config.action_dispatch.show_exceptions = :all
Copy link
Contributor Author

@hiboabd hiboabd Oct 31, 2023

Choose a reason for hiding this comment

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

Fixes a warning that appeared following an upgrade to rails: Setting action_dispatch.show_exceptions to true is deprecated. Set to :all instead.

There is another warning that I believe will be fixed by devise

@hiboabd hiboabd marked this pull request as ready for review October 31, 2023 14:16
@hiboabd hiboabd requested a review from a team as a code owner October 31, 2023 14:16
Copy link
Member

@timpeat timpeat left a comment

Choose a reason for hiding this comment

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

Great!

@hiboabd hiboabd merged commit 261aa13 into main Oct 31, 2023
4 checks passed
@hiboabd hiboabd deleted the CRIMAP-687-evidence-upload-logging branch October 31, 2023 14: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.

None yet

3 participants