codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
24 stars 23 forks source link

[Bug Report] - Add Contact no longer works #631

Closed andycwilliams closed 1 month ago

andycwilliams commented 1 month ago

Describe the bug:

When entering in a new contact using the Add Contact form, it fails to submit.

Expected behavior:

Using the Add Contact modal should add the entered data into the table.

Actual Behavior:

The information is not submitted and the modal remains open. The table does not display the new data even after refreshing.

According to the console, the error evidently originates from the handleAddContact function.

Screenshots:

AddContactFailing

To Reproduce:

Steps to reproduce the behavior:

  1. Go to Contacts
  2. Click on Add Contact
  3. Enter in the required fields and submit
  4. Check console for errors

Possible Fix:

Ensure handleAddContact function is properly passing in the submitted data.

Additional context:

After some (but not extensive) testing with several versions of the Development branch, my best current guess is that the error arose sometime between 2-4 weeks ago.

DionSat commented 1 month ago

Weird, I wonder if this is from when I added the OIDC provider dropdown. But it was working when I tested it before. I'll go ahead and take this on and check it out.

DionSat commented 1 month ago

I'm not encountering this error. I was able to add my test profiles and my solidcommunity webid as well. Can you reproduce the error again.

andycwilliams commented 1 month ago

I'm not encountering this error. I was able to add my test profiles and my solidcommunity webid as well. Can you reproduce the error again.

Weird. I'm on the development branch and still getting the same error. I've tried out real usernames, fake ones, with the optional fields and without them...Will have to look into it more what the difference is. Right now I'm pretty consumed by the PR I put up. So if you're not getting the error maybe it's just a problem with my machine or browser or something.

I also want to mention that the Add Contact button does not reset when the action fails. It stays greyed out and I have to refresh the page. Not sure if you can test for that since you're not encountering this error.

andycwilliams commented 1 month ago

Turns out this was a simple fix. I hadn't updated my .env file.

So if anyone else runs into this, be sure to add the following to your .env:

VITE_OIDC_WEBIDS = '{"http://localhost:3000/": "http://localhost:3000/user/profile/card#me", "https://opencommons.net/": "http://opencommons.net/user/profile/card#me", "https://solidcommunity.net/": "https://user.solidcommunity.net/profile/card#me", "https://login.inrupt.com/": "https://id.inrupt.com/user", "https://inrupt.net/": "https://id.inrupt.com/user"}'