Commit e10b97e
feat: [SIW-1971,SIW-2255,SIW-2258] Remote presentation error handling (#6917)
> [!WARNING]
> Depends on [this
PR](pagopa/io-react-native-wallet#223)
## Short description
This PR adds handling for certain potential errors in the remote
presentation flow.
## List of changes proposed in this pull request
- Implemented an error screen that allows users to retry the remote
presentation if a communication error occurs during the auth/response
step.
- Implemented an error screen to inform the user when the RP fails to
verify the Authorization Response. This screen will provide some useful
details about the encountered error.
- Implemented an error screen shown when the RP returns a non-compliant
Request Object.
## Demo
<details><summary>Auth Response Errors</summary>
<p>
| Communication Error | Verification Error|
|--------|--------|
|<video
src="https://github.com/user-attachments/assets/ad045d7c-3cde-47ac-9654-1497ce21aded"></video>|
<video
src="https://github.com/user-attachments/assets/c6fa7a53-da0a-446b-830b-9b305888eb47"></video>|
</p>
</details>
<details><summary>Non-Compliant Request Object</summary>
<p>
| Invalid Req Obj | Invalid Dcql Query |
|--------|--------|
|<video
src="https://github.com/user-attachments/assets/d33fffb4-438d-4c2f-95ef-8163c1d5b7b9"></video>|
<video
src="https://github.com/user-attachments/assets/c6295b97-2af8-49c5-afb1-124b75e7ff1f"></video>|
</p>
</details>
## How to test
### Auth Response Error
Using a proxy tool (I used Proxyman), intercept the POST request to
`auth/response` to simulate a communication error (such as a 500 status
code) or a validation error returned by the RP (status code 400 or 403),
in order to display the two error screens shown in the demo.
### Non-Compliant Request Object
- **Invalid Request Object:**
- From the
`node_modules/@pagopa/io-react-native-wallet/src/credential/presentation/05-verify-request-object.ts`
file, make the `verifyRequestObject` function throw an
`InvalidRequestObjectError`.
- **Invalid Dcql Query:**
- In the `ts/features/itwallet/presentation/remote/machine/actors.ts`
file, modify the `requestObject.dcql_query` value before calling
`evaluateDcqlQuery`.
> [!NOTE]
> The tests shown in the demo were performed using the test RP
---------
Co-authored-by: Gianluca Spada <[email protected]>
Co-authored-by: RiccardoMolinari95 <[email protected]>1 parent b86b000 commit e10b97e
File tree
10 files changed
+186
-9
lines changed- locales
- en
- it
- ts/features/itwallet
- common/hooks
- presentation/remote
- machine
- screens
10 files changed
+186
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4743 | 4743 | | |
4744 | 4744 | | |
4745 | 4745 | | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
| 4763 | + | |
| 4764 | + | |
4746 | 4765 | | |
4747 | 4766 | | |
4748 | 4767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4743 | 4743 | | |
4744 | 4744 | | |
4745 | 4745 | | |
| 4746 | + | |
| 4747 | + | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
| 4763 | + | |
| 4764 | + | |
4746 | 4765 | | |
4747 | 4766 | | |
4748 | 4767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
94 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 | | |
96 | 101 | | |
97 | 102 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
14 | 35 | | |
15 | 36 | | |
16 | 37 | | |
| |||
21 | 42 | | |
22 | 43 | | |
23 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
24 | 48 | | |
25 | 49 | | |
26 | 50 | | |
| |||
29 | 53 | | |
30 | 54 | | |
31 | 55 | | |
32 | | - | |
| 56 | + | |
33 | 57 | | |
34 | 58 | | |
35 | 59 | | |
| |||
62 | 86 | | |
63 | 87 | | |
64 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
65 | 107 | | |
66 | 108 | | |
67 | 109 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
| |||
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
48 | 56 | | |
49 | 57 | | |
50 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
| |||
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
142 | 219 | | |
143 | 220 | | |
144 | 221 | | |
| |||
174 | 251 | | |
175 | 252 | | |
176 | 253 | | |
| 254 | + | |
177 | 255 | | |
178 | 256 | | |
179 | 257 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3873 | 3873 | | |
3874 | 3874 | | |
3875 | 3875 | | |
3876 | | - | |
3877 | | - | |
3878 | | - | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
3879 | 3879 | | |
3880 | 3880 | | |
3881 | 3881 | | |
| |||
3891 | 3891 | | |
3892 | 3892 | | |
3893 | 3893 | | |
3894 | | - | |
| 3894 | + | |
3895 | 3895 | | |
3896 | 3896 | | |
3897 | 3897 | | |
| |||
13675 | 13675 | | |
13676 | 13676 | | |
13677 | 13677 | | |
13678 | | - | |
| 13678 | + | |
13679 | 13679 | | |
13680 | 13680 | | |
13681 | 13681 | | |
| |||
0 commit comments