Title: Failure when reading more than 500 messages from a MESH mailbox · Issue #60 · NHSDigital/mesh-client · GitHub
Open Graph Title: Failure when reading more than 500 messages from a MESH mailbox · Issue #60 · NHSDigital/mesh-client
X Title: Failure when reading more than 500 messages from a MESH mailbox · Issue #60 · NHSDigital/mesh-client
Description: Context We are using version 3.2.1 of the MESH-client. We are testing the last step of the pseudocode for MESH inbox cycle explained here: https://digital.nhs.uk/developer/api-catalogue/message-exchange-for-social-care-and-health-api#ove...
Open Graph Description: Context We are using version 3.2.1 of the MESH-client. We are testing the last step of the pseudocode for MESH inbox cycle explained here: https://digital.nhs.uk/developer/api-catalogue/message-exc...
X Description: Context We are using version 3.2.1 of the MESH-client. We are testing the last step of the pseudocode for MESH inbox cycle explained here: https://digital.nhs.uk/developer/api-catalogue/message-exc...
Opengraph URL: https://github.com/NHSDigital/mesh-client/issues/60
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Failure when reading more than 500 messages from a MESH mailbox","articleBody":"**Context**\r\n\r\nWe are using version 3.2.1 of the MESH-client.\r\nWe are testing the last step of the pseudocode for MESH inbox cycle explained here: https://digital.nhs.uk/developer/api-catalogue/message-exchange-for-social-care-and-health-api#overview--mesh-api-pseudocode\r\n\r\nWhenever our application tries to pull messages from MESH and there are more than 500 messages the MESH client throws the following exception:\r\n\r\n```\r\nERROR MissingSchema: Invalid URL '/messageexchange/**********/inbox...\r\nNo scheme supplied. Perhaps you meant https:///messageexchange/**********/inbox...\r\n```\r\n\r\nWith the following stack trace:\r\n\r\n```\r\nFile \\\"/var/task/mesh_client/__init__.py\\\", line 816, in iterate_message_ids\",\r\n result = self._inbox_v2_page(url=next_page)\",\r\nFile \\\"/var/task/mesh_client/__init__.py\\\", line 507, in _inbox_v2_page\",\r\n response = self._session.get(url, timeout=self._timeout, params=params)\",\r\nFile \\\"/var/task/requests/sessions.py\\\", line 602, in get\",\r\n return self.request(\\\"GET\\\", url, **kwargs)\",\r\nFile \\\"/var/task/requests/sessions.py\\\", line 575, in request\",\r\n prep = self.prepare_request(req)\",\r\nFile \\\"/var/task/requests/sessions.py\\\", line 486, in prepare_request\",\r\n p.prepare(\",\r\nFile \\\"/var/task/requests/models.py\\\", line 368, in prepare\",\r\n self.prepare_url(url, params)\",\r\nFile \\\"/var/task/requests/models.py\\\", line 439, in prepare_url\",\r\n raise MissingSchema(\",\r\n```\r\n\r\nThis occurs when trying to load the second batch of message (500 till the end). The reason is that the client expects the links object in the response to contain a fully qualifying URI: https://github.com/NHSDigital/mesh-client/blob/develop/mesh_client/__init__.py#L807-L817\r\nWhere instead the returned links object looks like this:\r\n```\r\n\"links\": {\r\n \"self\": \"/messageexchange/X26ABC1/inbox\"\r\n },\r\n```\r\n\r\n**Potential Fix**\r\n\r\nThis can be fixed by either\r\n\r\n- Updating the way that _inbox_v2_page function builds the url: https://github.com/NHSDigital/mesh-client/blob/develop/mesh_client/__init__.py#L506 To check the argument passed is a fully qualified url.\r\n\r\n- or the same check can be performed when extracting the URL from the links object here: \r\nhttps://github.com/NHSDigital/mesh-client/blob/develop/mesh_client/__init__.py#L807\r\n\r\n","author":{"url":"https://github.com/vivanov-grailbio","@type":"Person","name":"vivanov-grailbio"},"datePublished":"2024-02-06T12:10:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/60/mesh-client/issues/60"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bace82d6-f7b2-5ae1-b229-63851580773b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB38:2AE5C2:7150B4:A3464B:6A549241 |
| html-safe-nonce | a419774901830e4e32ecc58f0c819db280962157124a4f03b12aa75e8ce3bf46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjM4OjJBRTVDMjo3MTUwQjQ6QTM0NjRCOjZBNTQ5MjQxIiwidmlzaXRvcl9pZCI6IjE3ODIyODE4NTkwNTA1NDE2MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7856a3483b7943ee5f9762804d1220b46fcaaae30ab09a85342945ac492745b7 |
| hovercard-subject-tag | issue:2120629394 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NHSDigital/mesh-client/60/issue_layout |
| twitter:image | https://opengraph.githubassets.com/43d3b87a39044f0c5f6a6037e9c39fc8bd9574ea90feee74a79ed8de7f38cca9/NHSDigital/mesh-client/issues/60 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/43d3b87a39044f0c5f6a6037e9c39fc8bd9574ea90feee74a79ed8de7f38cca9/NHSDigital/mesh-client/issues/60 |
| og:image:alt | Context We are using version 3.2.1 of the MESH-client. We are testing the last step of the pseudocode for MESH inbox cycle explained here: https://digital.nhs.uk/developer/api-catalogue/message-exc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vivanov-grailbio |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/NHSDigital/mesh-client git https://github.com/NHSDigital/mesh-client.git |
| octolytics-dimension-user_id | 6683590 |
| octolytics-dimension-user_login | NHSDigital |
| octolytics-dimension-repository_id | 264230422 |
| octolytics-dimension-repository_nwo | NHSDigital/mesh-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 264230422 |
| octolytics-dimension-repository_network_root_nwo | NHSDigital/mesh-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width