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

91 pydantic v2 #203

Merged
merged 16 commits into from
Jul 29, 2024
Merged

91 pydantic v2 #203

merged 16 commits into from
Jul 29, 2024

Conversation

kjlippold
Copy link
Contributor

Updated Pydantic from v1 to v2 and several other minor dependencies.
Updated structure of accounts app to match core app more closely.

@kjlippold kjlippold self-assigned this Jul 18, 2024
Copy link
Contributor

@daniel-slaugh daniel-slaugh left a comment

Choose a reason for hiding this comment

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

I cloned this branch as well as the associated branch in the hydroserver-sensorthings repo and tested each endpoint manually through the DataManagement web app. Here's all the endpoints that have errors:

Things
Backend throws 404 error trying to remove a secondary owner from site
Backend throws 500 error trying to transfer primary ownership to a secondary owner
When adding a secondary owner from the site details page, the new owner doesn't get populated in the 'current owners' field. Is new owner being returned in the response?

Photos
Create a thing with a photo
Go to site details page
Photo doesn't show & the following error is thrown
GET https://dev.hydroserver2.org/photos/cacecb32-ed60-4824-9091-120774f45f3d/photo_name.png net::ERR_NAME_NOT_RESOLVED

HydroShare Archive
Backend throws a 500 error when trying to create a new resource
Couldn't test the other Archive endpoints since I couldn't create an archive

Datastream
Backend throws a 404 error when trying to delete a datastream

@kjlippold
Copy link
Contributor Author

@daniel-slaugh I've fixed the issues related to the Thing ownership endpoints for you to test again.

I wasn't able to recreate the Delete Datastream issue, but the error suggests that the test user didn't have permission to delete the resource, or the wrong UUID got passed somehow. Let me know which datastream/user you're testing with.

I had to reconnect to HydroShare from my test account, but after doing so archival seems to be working fine on my end. If it's still not working after reconnecting your HydroShare account, send me the logs for that error.

Photos can only be downloaded by the frontend if you're using Docker or AWS since api-services doesn't serve the photos directly. You should still be able to verify those endpoints are working if you can see the blank placeholders for the photos on the frontend. The download links, even though they won't work locally without Docker, should have the following pattern: {PROXY_BASE_URL}/photos/{THING_ID}/{PHOTO_ID}.{EXT}

@daniel-slaugh
Copy link
Contributor

@kjlippold Adding a secondary owner now updates the screen properly and transferring primary ownership now works, but I still get a 404 when trying to remove a user:

API Response Not OK: User with the given email not found.
SiteAccessControl.vue:248 Error removing owner from thing Error: 404

I also dug into why the access control's 'Remove' button for secondary users removing themselves from a site isn't showing and it's because the owner.email is just the user's first name so the check for 'if owner.email === user.email always fails.

I disconnected my account from HydroShare but when I tried to reconnect, I was redirected to a screen that said:
Error: invalid_request
Mismatching redirect URI.

Deleting a datastream works - I think I probably tried to delete it as a secondary owner.

@kjlippold
Copy link
Contributor Author

@daniel-slaugh The issues related to the email field being incorrect should be fixed now.

@daniel-slaugh
Copy link
Contributor

@kjlippold As the primary owner, I can successfully remove a secondary owner or transfer ownership to another user, and now the owner.email returns correctly, but I still get a 404 'Thing not found' error when trying to remove myself as a secondary owner of a site.

Steps to reproduce:
log in as paul@example.com
go to 'site in cheyenne creek'
transfer primary ownership to jane@example.com
Click the 'remove' button to remove paul as an owner of the site

PATCH http://localhost:8000/api/data/things/0c04fcdc-3876-429e-8260-14b7baca0231/ownership 404 (Not Found)

@kjlippold
Copy link
Contributor Author

@daniel-slaugh This endpoint should be working correctly now, can you please check again?

Copy link
Contributor

@daniel-slaugh daniel-slaugh left a comment

Choose a reason for hiding this comment

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

Looks good

@kjlippold kjlippold merged commit 3a7fff9 into main Jul 29, 2024
4 checks passed
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.

2 participants