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

Status-Override Persistence of VBADocuments::UploadSubmission #4470

Open
msimpson opened this issue Jul 1, 2020 · 0 comments
Open

Status-Override Persistence of VBADocuments::UploadSubmission #4470

msimpson opened this issue Jul 1, 2020 · 0 comments

Comments

@msimpson
Copy link

msimpson commented Jul 1, 2020

When providing a Status-Override for a VBADocuments::UploadSubmission is the change in status meant to be persistent? There is a save call on the submission after the change, but I am seeing the original status in the sandbox upon subsequent checks. For example:

2020-07-01T23:15:00.729Z

curl -X GET 'https://sandbox-api.va.gov/services/vba_documents/v1/uploads/8b743e06-71c7-478f-a94a-bb8264a59f0b' --header 'apikey: xxx' | jq
{
  "data": {
    "id": "8b743e06-71c7-478f-a94a-bb8264a59f0b",
    "type": "document_upload",
    "attributes": {
      "guid": "8b743e06-71c7-478f-a94a-bb8264a59f0b",
      "status": "received",
      "code": null,
      "detail": null,
      "location": null,
      "updated_at": "2020-07-01T23:15:00.729Z"
    }
  }
}

2020-07-01T23:17:25.700Z

curl -X GET 'https://sandbox-api.va.gov/services/vba_documents/v1/uploads/8b743e06-71c7-478f-a94a-bb8264a59f0b' --header 'Status-Override: processing' --header 'apikey: xxx' | jq
{
  "data": {
    "id": "8b743e06-71c7-478f-a94a-bb8264a59f0b",
    "type": "document_upload",
    "attributes": {
      "guid": "8b743e06-71c7-478f-a94a-bb8264a59f0b",
      "status": "processing",
      "code": null,
      "detail": null,
      "location": null,
      "updated_at": "2020-07-01T23:17:25.700Z"
    }
  }
}

2020-07-01T23:18:00.405Z

curl -X GET 'https://sandbox-api.va.gov/services/vba_documents/v1/uploads/8b743e06-71c7-478f-a94a-bb8264a59f0b' --header 'apikey: xxx' | jq
{
  "data": {
    "id": "8b743e06-71c7-478f-a94a-bb8264a59f0b",
    "type": "document_upload",
    "attributes": {
      "guid": "8b743e06-71c7-478f-a94a-bb8264a59f0b",
      "status": "received",
      "code": null,
      "detail": null,
      "location": null,
      "updated_at": "2020-07-01T23:18:00.405Z"
    }
  }
}

I walked through the vets-api code a bit to see if I could find a reason as to why the record wouldn't be saved, but I don't. Any help would be appreciated. Thanks.

EDIT
I took another look this morning and noticed the call to refresh_status! is likely resetting the status on subsequent requests given what it receives and immediately maps from CentralMail. Therefore, I can see why the Status-Override is behaving in a momentary fashion. But, the question remains, should it be?

The momentary behavior isn't very useful for testing as it removes the ability to poll and respond to changes of GUIDs, etc. In fact, the entire Status-Override process doesn't make much sense if this momentary behavior was the intended goal. Anyone targeting this API could simply stub out different status responses in their application, instead, and avoid the round trip.

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

No branches or pull requests

1 participant