Skip to content

Conversation

@annavik
Copy link
Member

@annavik annavik commented Mar 4, 2025

Here are our runtime errors reported on Sentry last 30 days (UI only).
Screenshot 2025-03-04 at 13 41 59

In this PR we take care of issue 1 and 3. The other issues I think are related to request timeouts, they are more difficult to reproduce and I can't fully understand the details (they are not including any references to the frontend code base).

About the fixes:

  • First issue is related to some missing data. For human identifications, the frontend app expects them to be associated with a user. However, for a few edge cases, seems like the user object is missing (see https://api-production.dev.insectai.org/api/v2/occurrences/11597/ for example). We can see the problem live here: https://antenna.insectai.org/projects/18/occurrences?ordering=-determination_score. After the fix, we will still present these identifications in UI, but with the user name "Unknown user".
  • The other issue was related to some unhandled promise rejections. If we await an async method that might throw errors, we should catch these errors. However the React Query library that we use is already taking care of the state handling for us, so we can actually leave the catch block empty. When using this lib, in most situations there is no need to await these methods. Example: https://tanstack.com/query/v3/docs/framework/react/guides/mutations
  • Also, we will include a fix for a problem that was recently discovered about pipelines not being connected to a processing service in the preview environment. After the fix, we will consider such pipelines as offline in the session detail view, instead of having the app crash.

@annavik annavik requested a review from mihow March 4, 2025 13:05
@annavik annavik linked an issue Mar 4, 2025 that may be closed by this pull request
}

this._humanIdentifications = this._occurrence.identifications
.filter((i: any) => !!i.user) // Workaround to avoid crash when the backend is not returning any user
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about keeping the identification but showing an unknown user? I wonder if this happens when the user is deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, that is better! History will make more sense. I have updated the code, such cases will now be presented like this:

Screenshot 2025-03-05 at 10 31 32

Copy link
Member Author

@annavik annavik Mar 5, 2025

Choose a reason for hiding this comment

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

The delete explanation sounds possible, no further backend investigation needed then?

@annavik annavik requested a review from mihow March 5, 2025 09:38
@annavik
Copy link
Member Author

annavik commented Mar 5, 2025

For the processing service problem discovered in #743 I have pushed a fix and updated the PR description.

@netlify
Copy link

netlify bot commented Mar 7, 2025

Deploy Preview for antenna-preview ready!

Name Link
🔨 Latest commit 2bb9d76
🔍 Latest deploy log https://app.netlify.com/sites/antenna-preview/deploys/67caa3075e698c0008f547a4
😎 Deploy Preview https://deploy-preview-756--antenna-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 64
Accessibility: 89
Best Practices: 92
SEO: 100
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@mihow mihow merged commit 2b10df2 into main Mar 7, 2025
6 checks passed
@mihow mihow deleted the fix/handle-runtime-problems branch March 7, 2025 08:04
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.

Look into runtime issues reported on Sentry

3 participants