PhilanthropyDataCommons / service

A project for collecting and serving public information associated with grant applications
GNU Affero General Public License v3.0
8 stars 2 forks source link

Proposal data is "not found" #951

Closed slifty closed 6 months ago

slifty commented 6 months ago
          I _think_ this might be broken. Locally:

Hitting http://localhost:3001/proposals?_page=1&_count=100&organization=10 returns:

{
  "entries": [
    {
      "id": 114,
      "versions": [...],
      "createdAt": "2024-04-19T16:32:58.714618-05:00",
      "createdBy": 5,
      "externalId": "2",
      "opportunityId": 54
    },
    {
      "id": 112,
      "versions": [...],
      "createdAt": "2024-04-19T16:32:54.533533-05:00",
      "createdBy": 5,
      "externalId": "2",
      "opportunityId": 53
    }
  ],
  "total": 110
}

But then hitting http://localhost:3001/proposals/114 returns:

{
  "name": "NotFoundError",
  "message": "The proposal was not found (id: 114)",
  "details": [
    {
      "name": "NotFoundError"
    }
  ]
}

Originally posted by @reefdog in https://github.com/PhilanthropyDataCommons/service/issues/932#issuecomment-2071351538

reefdog commented 6 months ago

@slifty This is a showstopping bug atm. Proposal detail pages, and proposal "side panel" pages on org pages — both of which are crucial — are currently broken.

hminsky2002 commented 6 months ago

@reefdog @slifty What are the steps to reproduce this? On local, I'm running the latest main branch for front-end and service and am seeing expected behavior!

UI

Screen Shot 2024-04-23 at 11 41 08 PM

with proposal pages

Screen Shot 2024-04-23 at 11 41 14 PM

corresponding organization panel

API (via swagger)

http://localhost:3001/proposals?_page=1&_count=100&organization=1 returns

{
  "entries": [
    {
      "id": 1,
      "versions": [
        {
          "id": 1,
          "version": 1,
          "createdAt": "2024-04-15T12:13:11.851105-04:00",
          "proposalId": 1,
          "fieldValues": [
            {
              "id": 1,
              "value": "test1",
              "isValid": true,
              "position": 0,
              "createdAt": "2024-04-15T12:13:11.88021-04:00",
              "proposalVersionId": 1,
              "applicationFormField": {
               // etc
              },
              "applicationFormFieldId": 1
            },
           //etc etc
          ],
          "applicationFormId": 1
        }
      ],
      "createdAt": "2024-04-15T12:13:11.826575-04:00",
      "createdBy": 2,
      "externalId": "1",
      "opportunityId": 1
    }
  ],
  "total": 3
}

while http://localhost:3001/proposals/1 returns


Download
{
  "id": 1,
  "versions": [
    {
      "id": 1,
      "version": 1,
      "createdAt": "2024-04-15T12:13:11.851105-04:00",
      "proposalId": 1,
      "fieldValues": [
        {
          "id": 1,
          "value": "test1",
          "isValid": true,
          "position": 0,
          "createdAt": "2024-04-15T12:13:11.88021-04:00",
          "proposalVersionId": 1,
          "applicationFormField": {
          // etc
        },

  ],
  "createdAt": "2024-04-15T12:13:11.826575-04:00",
  "createdBy": 2,
  "externalId": "1",
  "opportunityId": 1
}
reefdog commented 6 months ago

@hminsky2002 I think the trick is you have to try to view a proposal that isn't yours, but as an admin.

slifty commented 6 months ago

@reefdog based on your response in the other thread I thought you were viewing a proposal you did own as an admin. Is that the case or no?

reefdog commented 6 months ago

~@slifty 🤦 You're right. Late night Justin was… confused. So this is even more weird then.~

Okay figured it out with @slifty while pairing. In the original thread I thought I was viewing my own proposals, but wasn't. (I had user IDs confused.) So my comment above is correct — the bug was when an admin tried to view someone else's proposal details — but contradicted my original report.

Dan's on it and has a fix.