Commit a24fd1f
committed
5976 Fix inconsistent display of card details
Previously, the refund screen was not displaying the card details consistently, especially missing them for orders where the payment had just been taken.
When loading the order again, the `update(with:)` function was not setting the chargeID we'd recieved from the network on the storage, it was only set when the order was first inserted from a new fetch.
Setting `chargeID` in `update(with:)` fixed these issues, however, @koke's suggestion that they may be caused by the list fetch overwriting the `chargeID` with nil because of the fields on the list fetch not including `meta_data` needed investigation.
I found that they were indeed being overwritten, but then we would fetch fresh data again including the chargeID when entering the Order Details screen before the refund, so in general the chargeID was always present.
To reduce the risk of a race condition or other future bugs here, I changed all Order requests to fetch `meta_data`. With this, I can see that `chargeID` doesn't get incorrectly set to `nil` any more. The `singleOrderExtraFields` was initially added to avoid fetching `line_items` for every order when viewing the list, for performance reasons. We will discuss whether or not this is desirable, and whether we should provide for this in the storage layer with flags to say "don't update these fields".1 parent 48b0c13 commit a24fd1f
File tree
2 files changed
+6
-2
lines changed- Networking/Networking/Remote
- Yosemite/Yosemite/Model/Storage
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
274 | 277 | | |
275 | | - | |
| 278 | + | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
0 commit comments