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

feat: [IOCOM-435] Add polling for download F24 attachments #5149

Merged
merged 20 commits into from
Oct 26, 2023

Conversation

adelloste
Copy link
Member

@adelloste adelloste commented Oct 20, 2023

Short description

This PR adds polling for download F24 attachments.
When the app requests the download of an F24 attachment, if the backend responds with a 503 code with the retry-after header value set, the app will wait for the time specified in the header before making the next request.

Preview

Registrazione.schermo.2023-10-20.alle.15.12.06.mov

List of changes proposed in this pull request

  • Added polling management.
  • Renamed the downloadAttachment file to handleDownloadAttachment
  • Renamed the clearAttachments file to handleClearAttachments
  • Extracted the generator functions that initialize requests into a new file

How to test

Generate a generic message with attachments and a PN message with attachments and F24 using io-dev-api-server.
In case of a 503 and retry-after, check that the requests are handled correctly: the app should wait for n seconds before making the next request

@adelloste adelloste temporarily deployed to dev October 20, 2023 14:53 — with GitHub Actions Inactive
@pagopa-github-bot pagopa-github-bot changed the title [IOCOM-435] Add polling for download F24 attachments feat: [IOCOM-435] Add polling for download F24 attachments Oct 20, 2023
@pagopa-github-bot
Copy link
Collaborator

pagopa-github-bot commented Oct 20, 2023

Affected stories

  • 🌟 IOCOM-435: [APP] Download in polling del Modello F24
    subtask of
    • 🌟 IOCOM-413: [APP] Modellare i dati dalle API

Generated by 🚫 dangerJS against 53e2605

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #5149 (3d53c3c) into master (be80fe0) will decrease coverage by 0.02%.
The diff coverage is 59.72%.

❗ Current head 3d53c3c differs from pull request most recent head 53e2605. Consider uploading reports for the commit 53e2605 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5149      +/-   ##
==========================================
- Coverage   47.77%   47.76%   -0.02%     
==========================================
  Files        1534     1535       +1     
  Lines       31631    31645      +14     
  Branches     7873     7875       +2     
==========================================
+ Hits        15112    15115       +3     
- Misses      16463    16474      +11     
  Partials       56       56              
Files Coverage Δ
ts/sagas/startup.ts 34.68% <100.00%> (ø)
...s/features/messages/saga/handleClearAttachments.ts 0.00% <0.00%> (ø)
ts/features/messages/saga/handleRequestInit.ts 92.30% <92.30%> (ø)
ts/features/messages/utils/strings.ts 33.33% <33.33%> (ø)
ts/features/messages/saga/index.ts 0.00% <0.00%> (ø)
...features/messages/saga/handleDownloadAttachment.ts 65.90% <65.90%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be80fe0...53e2605. Read the comment docs.

@adelloste adelloste temporarily deployed to dev October 21, 2023 16:15 — with GitHub Actions Inactive
@adelloste adelloste temporarily deployed to dev October 23, 2023 12:52 — with GitHub Actions Inactive
@adelloste adelloste temporarily deployed to dev October 23, 2023 12:57 — with GitHub Actions Inactive
@adelloste adelloste marked this pull request as ready for review October 23, 2023 14:00
@adelloste adelloste requested a review from a team as a code owner October 23, 2023 14:00
@adelloste adelloste temporarily deployed to dev October 25, 2023 10:39 — with GitHub Actions Inactive
ts/features/messages/utils/strings.ts Outdated Show resolved Hide resolved
ts/features/messages/saga/index.ts Outdated Show resolved Hide resolved
ts/features/messages/saga/handleDownloadAttachment.ts Outdated Show resolved Hide resolved
ts/features/messages/saga/handleDownloadAttachment.ts Outdated Show resolved Hide resolved
@Vangaorth Vangaorth temporarily deployed to dev October 25, 2023 15:19 — with GitHub Actions Inactive
@adelloste adelloste temporarily deployed to dev October 25, 2023 18:23 — with GitHub Actions Inactive
@adelloste adelloste temporarily deployed to dev October 25, 2023 18:26 — with GitHub Actions Inactive
@adelloste adelloste temporarily deployed to dev October 26, 2023 07:29 — with GitHub Actions Inactive
@dpulls
Copy link

dpulls bot commented Oct 26, 2023

🎉 All dependencies have been resolved !

@adelloste adelloste temporarily deployed to dev October 26, 2023 08:57 — with GitHub Actions Inactive
Copy link
Contributor

@Vangaorth Vangaorth left a comment

Choose a reason for hiding this comment

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

LGTM

@adelloste adelloste merged commit 1b9188b into master Oct 26, 2023
5 checks passed
@adelloste adelloste deleted the IOCOM-435-polling-f24 branch October 26, 2023 09:41
adelloste added a commit that referenced this pull request Oct 27, 2023
> [!warning]
> This PR depends on #5149 

## Short description
This PR adds support for F24 section on SEND message screen. If we have
only one F24, it is rendered in the detail of the message otherwise the
"Vedi modelli F24" button is rendered.

### Preview

| === 1 | > 1 |
| --- | --- |
| <img
src="https://github.com/pagopa/io-app/assets/29163287/916e080a-0012-4a2b-b2b9-f50dbb4edc82"
width="300" /> | <img
src="https://github.com/pagopa/io-app/assets/29163287/67876ced-7014-44e7-af78-5854af79e43e"
width="300" /> |

## List of changes proposed in this pull request
- Added F24 section
- Added the new component `MessageAttachments`
- Marked as legacy the old component `MessageAttachments`
- Updated langs   

## How to test
Generate a SEND message with F24 attachemts using `io-dev-api-server`.
Check that F24 section is displayed correctly.

---------

Co-authored-by: Andrea <andrea.piai@pagopa.it>
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.

3 participants