codeforpdx / PASS

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

[Bug Report] - Civic Profile Submission #615

Closed leekahung closed 2 months ago

leekahung commented 2 months ago

Describe the bug:

Currently, been trying to get information added to the Civic Profile. However, I'm currently getting errors with regards to that functionality (see clip below).

Expected behavior:

Was expecting to let users update housing information from the submission forms and update the relevant TTL file in the back.

Screenshots:

https://github.com/codeforpdx/PASS/assets/14917816/7e3338fa-0a76-44e8-b90a-8229bdf724c7

To Reproduce:

Steps to reproduce the behavior:

  1. Go to "Civic Profile"
  2. Insert information for form
  3. Click on "Submit" button
  4. See error

Possible Fix:

Checking existing functionality for adding information onto Solid and updating the function if needed

JaeGif commented 2 months ago

I'll take a crack at this one. Seems like a good starting place to get acquainted with the codebase.

JaeGif commented 2 months ago

Seems what's happening is that the storedDataset state is occasionally null when the addMutation is run. In useRdfCollection ln 74, mutate attempts to access the storedDataset and it doesn't exist throwing the error.

Easiest way I found to work around is to add a useEffect to HousingInfo, that forces a refetch if storedDataset is null.