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

Ability to update Camera serial numbers #228

Closed
5 tasks done
Tracked by #148
nathanielrindlaub opened this issue Aug 13, 2024 · 4 comments
Closed
5 tasks done
Tracked by #148

Ability to update Camera serial numbers #228

nathanielrindlaub opened this issue Aug 13, 2024 · 4 comments

Comments

@nathanielrindlaub
Copy link
Member

nathanielrindlaub commented Aug 13, 2024

This is a highly asked for feature so should be high priority. People often mistype the Serial Number Override and are looking for a way to change that after the fact, which currently isn't possible. This would only possible for non-wireless cameras.

Front-end tasks:

  • add context menu to the cameras listed in the filters section, button/item to update, and a simple input to input the new SN.
  • add button to trigger from camera admin modal

Back-end tasks:

  • update all matching Image's cameraId field. We would likely want this to be an async task, but perhaps MongoDB updateMany would be fast at this. Needs testing.
  • would also have to update cameraConfig
  • because it's a mulit-step operation, we'd need to reverse any successful operations if others fail. Because the first operation is an updateMany() on all of the affected Images, in order to reverse this later on the very first thing we'd need to do in the updateSerialNumber() method is to get a list of all Image _ids that have the source's cameraId, hang on to that in memory, and then if we need to reverse the updateMany we'd have to bulkWrite their cameraIds back to the original value.
@nathanielrindlaub
Copy link
Member Author

nathanielrindlaub commented Aug 26, 2024

  • In frontend and in documentation, update warnings about using Serial Number Overrides to indicate that it is no longer irreversible.

@nathanielrindlaub
Copy link
Member Author

Note on updateMany() timing tests: it took 2.4 seconds to perform the updateMany() operation on 21,350 images (the entire round-trip call took 2.7 seconds), so at the current Lambda timeout of 30 seconds, I'm guessing we could support updating ~200k images before timing out without using an async task.

That seems like a lot, and would probably be more than enough most of the time, but I worry about the consequences of timeouts/incomplete uploads for really big update jobs. I think the safer move here would be to make this an async task, unfortunately. We likely will need to make bulk image deletion (#227) async, so perhaps now is the time to build out a more generic task-monitoring table in the frontend for this kind of thing.

@nathanielrindlaub
Copy link
Member Author

nathanielrindlaub commented Sep 4, 2024

  • prevent users from closing update SN modal while loading (frontend)
  • close modal after successful completion of task (frontend)
  • refresh project/cameras after successful completion? (frontend)
  • ensure users can't change SNs on wireless cameras (frontend, this should already be the case on backend but test)
  • test what happens when you change the camera's SN to one that already exists for that project. Should we allow that? If so should we allow it for merging images into a wireless camera? We'd also need to re-map the images to deployments if so.

@nathanielrindlaub
Copy link
Member Author

nathanielrindlaub commented Sep 4, 2024

Make the distinction between "cameras" and "deployments" more clear in the filters panel. It's already is pretty confusing. Two light-touch ideas might be to

  • (a) add a tooltip to the camera filter that says something like "Camera [cameraSN] deployments", so at least it tells you the camera SN on hover, and
  • (b) add a note to the top of the update SN modal that says "Updating the camera serial number is not the same thing as creating a Deployment, etc." and link to Deployment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant