QutEcoacoustics / workbench-client

workbench-client: a client side browser application for interacting with acoustic workbenches
Other
8 stars 1 forks source link

Audio recordings list & details page should not display error when not logged in #2053

Open hudson-newey opened 1 year ago

hudson-newey commented 1 year ago

Describe the bug When not logged in and accessing a project/region/sites audio recordings list & details page, a Toast error is presented to the user stating "You need to log in or register to continue".

Despite this, the user can continue browsing audio recordings without logging in or registering. The only action that they can't perform is see the name of the uploader.

On the audio recording list pages we already display information bubbles next the uploader column if the user is not logged in (image attached below) saying that the user needs to log in to see this field. Therefore, the user is receiving an error message that we already have an information bubble describing.

This can confuse users, look messy, and appear like the client is broken.

To Reproduce Steps to reproduce the behavior:

  1. Log out of account (if applicable)
  2. Go to www.ecosounds.org/projects/1029/sites/1178/audio_recordings
  3. Observe the toast error

Expected behavior

a. Catch the error and don't display the toast error. Instead rely on the information bubbles providing feedback to the user on actions required to see the field b. Change the toast to an information toast with a message along the lines of "Some information on this page may be incomplete. Log in to see the full details." c. On error, redirect the user to the log in screen

Screenshots image Toast error that is presented to the user

image Information bubbles that are shown if the user needs to log in to see the information

Desktop (please complete the following information):

Additional context The error comes from a client side api error, where the client shows an error because the api returns the 401 Unauthorized error when fetching the user who uploaded the audio recording.

This error does not actually prevent the user from performing any actions

Before this issue is completed, we should probably tackle #2035 first.

atruskie commented 1 year ago

Yeah, good catch.

We added some default error messages for responses that fail, but we need to make sure they don't occur for requests that come from relation loading (loading associated models).

hudson-newey commented 1 year ago

The same issue can be observed on the Site / Point details page when not logged in

This arises from the "Recent Annotations" section of the details view

image