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

Added content message delivery for SubscriptionWebsocketHandler #5692

Merged

Conversation

ArtyomyuS
Copy link
Contributor

Description

  • This pull-request provides new support for the subscription R5 topic based to consider content property for the delivered messages so that if content is IDONLY the web socket message to contain an id, in case of FULLREFERENCE to consider the payload of the resource. In case of no content provided the payload remain as today: EMPTY. This pull-request does not affect previous FHIR versions nor any of the existing behaviour related to web socket messages.
  • linked issues 5683

Quotes about findings and assumptions

  • Not sure about the content type if that shall be covered as well inside this pull-request

Brief change log

  • Updated ca.uhn.fhir.jpa.subscription.match.deliver.websocket.SubscriptionWebsocketHandler
  • Changed the implementation for the method handleMessage(Message<?> theMessage)
  • This pull-request doesn't not include unit tests for the new functionality. First draft review is required.

Verifying this change

This change added tests and can be verified as follows:

  • To be done after first draft review

Documentation

@ArtyomyuS ArtyomyuS changed the title Added content message delivery for SubscriptionWebsocketHandler DRAFT: Added content message delivery for SubscriptionWebsocketHandler Feb 8, 2024
@ArtyomyuS ArtyomyuS marked this pull request as draft February 9, 2024 07:37
@ArtyomyuS
Copy link
Contributor Author

Hellow @jamesagnew , @fil512 , @tadgh could you please have an initial review, to confirm the pull-request is ok to be continued 👍 . Thanks

@jamesagnew
Copy link
Collaborator

@ArtyomyuS this approach looks good to me!

@ArtyomyuS
Copy link
Contributor Author

Going to provide additional test 👍

@ArtyomyuS
Copy link
Contributor Author

Hey @jamesagnew would you recommend update BaseSubscriptionDeliverySubscriberTest for the new changes or consider a new test class to fully support SubscriptionWebsocketHandler?

I challenge it as I can see the actual mocks within BaseSubscriptionDeliverySubscriberTest does not consider any of the SubscriptionWebsocketHandler implementations.

Please advice

@ArtyomyuS
Copy link
Contributor Author

Hello @jamesagnew sorry if the question was not clear. Shall I create a new test class like: ca.uhn.fhir.jpa.subscription.match.deliver.websocket.SubscriptionWebsocketHandlerTest? Or shall I use an existing class for the payload content testing.

Thanks for your support.

@jamesagnew
Copy link
Collaborator

I would think putting a new test next to WebsocketWithSubscriptionIdR4Test would be the best spot - you could base your test largely on that test too

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2f5ffe7) 81.32% compared to head (151ec38) 83.39%.
Report is 452 commits behind head on master.

❗ Current head 151ec38 differs from pull request most recent head 39fac93. Consider uploading reports for the commit 39fac93 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5692      +/-   ##
============================================
+ Coverage     81.32%   83.39%   +2.06%     
- Complexity    23650    26888    +3238     
============================================
  Files          1425     1679     +254     
  Lines         86399   103818   +17419     
  Branches      11677    13155    +1478     
============================================
+ Hits          70265    86578   +16313     
- Misses        10947    11607     +660     
- Partials       5187     5633     +446     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ubscription topic content: id-only, empty and full-resource
@ArtyomyuS
Copy link
Contributor Author

Hello @jamesagnew , provided unit tests. I thought it shall be more appropriate to have them inside hapi-fhir-jpaserver-test-r5. Please advice if there are changes required. The pull-request is ready for review.

@ArtyomyuS ArtyomyuS marked this pull request as ready for review February 14, 2024 15:25
@ArtyomyuS ArtyomyuS changed the title DRAFT: Added content message delivery for SubscriptionWebsocketHandler Added content message delivery for SubscriptionWebsocketHandler Feb 14, 2024
@jamesagnew
Copy link
Collaborator

Initial glance looks great! Once CI passes I'll give it a real review and get it merged. Thanks for the contribution!

@jamesagnew
Copy link
Collaborator

@ArtyomyuS looks like the spotless code formatting check failed. Can you run mvn spotless:apply and then commit+push the results to your branch?

@ArtyomyuS
Copy link
Contributor Author

Hey @jamesagnew run the code, hopefully it works 🤞

@ArtyomyuS
Copy link
Contributor Author

Hey @jamesagnew any clue why the mvn spotless:apply does not apply any changes on the current code?

Screen.Recording.2024-02-15.at.15.31.06.mov

@ArtyomyuS
Copy link
Contributor Author

Also looking into the check pipeline it shows success: https://github.com/hapifhir/hapi-fhir/actions/runs/7906650465/job/21582427202?pr=5692#step:4:8399

@ArtyomyuS
Copy link
Contributor Author

Hello @jamesagnew I guess we shall be fine now. Thank you

@ArtyomyuS
Copy link
Contributor Author

Hey @jamesagnew any thought on the pull-request. Thank you for the support 🙏

@jamesagnew jamesagnew enabled auto-merge (squash) February 21, 2024 18:22
@ArtyomyuS
Copy link
Contributor Author

Hello @jamesagnew I can see we're progressing with the pull-request, is there anything I could help more here? 💪

@jamesagnew jamesagnew merged commit d8f6c10 into hapifhir:master Feb 26, 2024
60 of 63 checks passed
@ArtyomyuS ArtyomyuS deleted the 5687-websocket-subscription-content-type branch February 27, 2024 06:31
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

Successfully merging this pull request may close these issues.

None yet

2 participants