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

Mobile: Create new Secure Messaging Threads endpoint #12851

Merged
merged 0 commits into from
Jun 5, 2023

Conversation

Tonksthebear
Copy link
Contributor

Summary

Create a new endpoint that uses the new Secure Messaging Threads api

Related issue(s)

department-of-veterans-affairs/va.gov-team#5621

Testing done

Added tests to the module spec

Screenshots

Note: Optional

What areas of the site does it impact?

None (completely new endpoint)

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Requested Feedback

How to integrate pagination

@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main May 31, 2023 22:37 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main May 31, 2023 22:48 Inactive
@Tonksthebear Tonksthebear marked this pull request as ready for review June 1, 2023 18:30
@Tonksthebear Tonksthebear requested review from a team as code owners June 1, 2023 18:30
@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 1, 2023 18:30 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 1, 2023 18:31 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 1, 2023 19:01 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 1, 2023 19:09 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 1, 2023 21:04 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 1, 2023 21:43 Inactive

require 'rails_helper'
require_relative '../support/iam_session_helper'
require_relative '../support/mobile_sm_client_helper'
Copy link
Contributor

Choose a reason for hiding this comment

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

with my VCR PR just being merged, these should be pointing to the helpers folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooo good catch, thanks. I just merged master so I'll make sure that passes

@Tonksthebear Tonksthebear requested a review from aherzberg June 1, 2023 22:10
@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 1, 2023 22:10 In progress
end
end

context 'Advanced User' do
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe all mobile users are premium users (I forget where I heard this so we may want to verify that ) so I don't think basic and advanced user specs will apply.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind. I just looked up the slack conversation that talked about this and it's not true. we can have MHV advanced and basic users.

content:
application/json:
schema:
$ref: ./schemas/SecureMessageList.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be SecureMessageThreadList?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 1, 2023 22:39 Inactive
kpethtel
kpethtel previously approved these changes Jun 2, 2023
Copy link
Contributor

@kpethtel kpethtel left a comment

Choose a reason for hiding this comment

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

I think Andrew is probably right about renaming that schema file. Looks good and I don't consider any of my feedback to be blocking.

- description: The field to sort the results by
in: query
name: sortField,
required: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know if all of these are actually required? Will our front end even be using them? The client is written to always use them but it's not clear if omitting them causes any issues because they don't have any sample specs addressing it, nor do they require the params in the controller. I guess we'll find out in testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can always set a default in the controller so that it's not required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of the fields outside of folder id are required so I required from those

type: string
enum: [ ASC, DESC ]
- $ref: "#/components/parameters/InflectionHeader"
responses:
Copy link
Contributor

Choose a reason for hiding this comment

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

The question has been coming up recently of "should these docs define all possible responses?" That would mean that every single entry in this file should have a section for 500, 502, 503, etc. I don't think you need to make any changes, but we do need to have that conversation sometime and this PR is reminding me. I'm going to file a ticket today for figuring that out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya I was going to wait until that discussion comes to a conclusion

Copy link
Contributor

Choose a reason for hiding this comment

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

I've created a ticket for it, so I'd say just skip it for now.

end

expect(response).to be_successful
expect(response).to match_camelized_response_schema('message_threads')
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it would be worth having a "matches exactly this" test? It's not the most graceful, but I've been burned by schema tests too many times and don't trust them. Also, it can be helpful at times to have an example of the data in the specs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remember you saying that before. I just updated it now

@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 2, 2023 16:38 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 2, 2023 16:39 Inactive
@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 2, 2023 16:43 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 2, 2023 16:44 Inactive
aherzberg
aherzberg previously approved these changes Jun 2, 2023
Copy link
Contributor

@aherzberg aherzberg left a comment

Choose a reason for hiding this comment

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

LGTM

@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 2, 2023 17:26 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 2, 2023 17:29 Inactive
@Tonksthebear Tonksthebear requested a review from aherzberg June 2, 2023 17:34
@va-vsp-bot va-vsp-bot requested a deployment to secure_messaging_threads/main/main June 2, 2023 17:38 In progress
@va-vfs-bot va-vfs-bot temporarily deployed to secure_messaging_threads/main/main June 2, 2023 17:38 Inactive
schema:
type: string
enum: [ SENDER_NAME, RECIPIENT_NAME, SENT_DATE, DRAFT_DATE ]
- description: The order to sort the results by
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know if this defaults to ASC or DESC? Could be worth capturing that and also the fact that page defaults to 1 (even though that's pretty obvious).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DESC I believe. I just tried sender_name and the order was ISLAM, MOHAMMAD RAFIQ then GOPARAJU, BHANU

Copy link
Contributor

@aherzberg aherzberg left a comment

Choose a reason for hiding this comment

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

LGTM

@Tonksthebear Tonksthebear merged commit 87d02f2 into master Jun 5, 2023
@Tonksthebear Tonksthebear deleted the secure_messaging_threads branch June 5, 2023 23:10
ryan-mcneil pushed a commit that referenced this pull request Dec 11, 2023
* Create new endpoint

* Rubocop

* Update documentation and add new error response

* Update parameter name to what front end uses

* Update spec to new directory structure

* Reference correct 200 schema

* Update spec to check specific return

* Remove required from parameters that aren't required

* Update documentation description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants