Skip to content

Conversation

@annavik
Copy link
Member

@annavik annavik commented Aug 21, 2023

There seems to be some confusions with captures in session detail view. Some images are forever loading and also we have some infinite scroll issues. I have looked in to it and I think the data is a bit strange for some sessions... We could make some things clearer on the FE side though.

Issue 1: Images not showing
This issue is related to some session images missing full URL in the response. I have updated the frame loader to stop the loading on error, to make it more clear in UI what happens. In order to solve it, I think we need some BE updates though.

See example: https://api.dev.insectai.org/api/v2/captures/?ordering=timestamp&limit=20&offset=20&event=1 (the item with id 38 does not have a full URL for the image, compared to item with id 128).

Issue 2: Infinite scroll
Sometimes we get into a state where the app will continue to load previous items. This is because while the top item is visible, we will continue to check if any previous items are to be loaded. Since the captures look very similar (without detections), it's not obvious that more items are in fact appended.

I suggest we do a (temporary?) update to the UI here, so that we instead load more items on button click. While we are testing things out, I think it might be nice to give users control of the loading. Later on, we could perhaps also look into updating scroll position when items are appended, to make things more clear.

What is also strange though, is that we end up on the offset that we do. For example, if we specify capture id to be 1 (https://api.dev.insectai.org/api/v2/events/1/?capture=1), we get "capture_page_offset" set to 5824 in the response, which seems wrong. I think this is why the linking to a specific capture is not working properly atm! :)

@netlify
Copy link

netlify bot commented Aug 21, 2023

Deploy Preview for ami-web ready!

Name Link
🔨 Latest commit abd6a29
🔍 Latest deploy log https://app.netlify.com/sites/ami-web/deploys/64e480536ff0c00008500946
😎 Deploy Preview https://deploy-preview-205--ami-web.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@annavik annavik marked this pull request as ready for review August 21, 2023 14:51
@netlify
Copy link

netlify bot commented Aug 21, 2023

Deploy Preview for ami-storybook ready!

Name Link
🔨 Latest commit abd6a29
🔍 Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/64e48053a544910008618aea
😎 Deploy Preview https://deploy-preview-205--ami-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@mihow
Copy link
Collaborator

mihow commented Aug 22, 2023

Thanks for investigating this. Already the fix for reloading on error is a big help.

I say definitely increase the page size, how about to 200? I think we had it at 20 to test pagination for short sessions.

I fixed some of the images that had a missing full path, but there is one session where the whole folder is missing in the object store (June 20th). I think it only existed on my local machine when I created the test dataset.

I will look into the offset issue. I think it may be because some queries are filtering by project now and others are not. I made a ticket here #206

I am okay to disable the auto scroll for the time being. Especially since this component will be changed.

@annavik annavik changed the title [Draft]: Investigate issues in session details Investigate issues in session details Aug 22, 2023
@annavik
Copy link
Member Author

annavik commented Aug 22, 2023

Strange with the missing images! I could default to a host if URL is just a path, but it sounds like that would not help us then?

Updated page offset to 200 and removed some unused code. Since we have a separate task for capture offset, I think this can be merged then?

@annavik annavik requested a review from mihow August 22, 2023 09:56
Copy link
Collaborator

@mihow mihow left a comment

Choose a reason for hiding this comment

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

This is working for me except for the missing captures and bad offset for which I have made tickets for myself!
#209
#206

@mihow mihow merged commit 0c2515b into main Aug 23, 2023
mihow pushed a commit that referenced this pull request Aug 24, 2023
* Set session image load to false on error

* Replace infinite scroll with buttons

* Remove unused hook

* Tweak copy and page size
mihow added a commit that referenced this pull request Aug 25, 2023
* Rename trapdata import script

* Import deployment captures from S3 source

* Temporary method for resizing images in s3

* Fix migrations and bad admin merge

* Basic method to import SourceImages from S3

* Update last-checked time

* Reorder properties

* Enable pagination for label studio

* New storage config model for per-deployment storage

* No global S3 config needed

* Allow deployments to re-use datasources with subdirs

* Fix result count and display URI

* Background tasks for image import & stats

* Paginate s3 listings

* Update calculated fields on bulk insert, fix size

* Split captures into sessions

* Updates for importing images & creating events

* Use db query for deployment file size instead

* Use django-storages in all environments

* Fix migration for existing data

* Fix for groups with length 0

* Comments

* Handle project with no detections/occurrences

* Speed up the project response

* Fix deployment list while keeping project page fast

* Speed up project overview page

* Move slow update to a background task

* Add forgotten changes to tasks

* Enable dragging

* Tweak min zoom

* Tweak mini map zoom

* Investigate issues in session details - Disable infinite scroll (#205)

* Set session image load to false on error

* Replace infinite scroll with buttons

* Remove unused hook

* Tweak copy and page size

* Skip proxy and update map search URL (#210)

* Optimize capture sync in batches

* Alawys assume public url path should bre relative to bucket

* Filter summary by project

---------

Co-authored-by: Debian <debian@gpu-3.novalocal>
Co-authored-by: Anna Viklund <annamariaviklund@gmail.com>
@annavik annavik deleted the web-ui-tweak-session-details branch October 11, 2023 06:21
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.

3 participants