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
[MBL-59] Fix personal data export. #1836
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1836 +/- ##
==========================================
- Coverage 84.54% 84.53% -0.01%
==========================================
Files 1273 1274 +1
Lines 115190 115216 +26
Branches 30656 30666 +10
==========================================
+ Hits 97387 97400 +13
- Misses 16734 16748 +14
+ Partials 1069 1068 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few clean up things, and if you want a default case for anything that doesn't fit the existing enum values use default
as your final case.
enum Fruit {
case mango
case apple
case banana
case kiwi
case pear
}
switch fruit {
case .apple:
print("only prints apple")
case .banana:
print("only prints banana")
case .mango:
print("only prints mango")
default:
print("prints for all other fruit")
}
All info on Swift enums here.
I ran a quick smoke test on simulator - it seems to work just like in the video.
Developer can own the acceptance criteria, if there's specific "Developer Testing" you want done, just add that as a section. Example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gtg once cleanup and "unknown" state suggestions are done. requesting data works as expected on my end 👍
Update `ExportDataEnvelope` `State` types to align with the types defined by the server. Update related logic to be more readable. Also update some test cases to default to `none` instead of `expired`, now that `none` is the default state for users that have never requested their data before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work! Just re-assign once ready for review again (you were probably already going to do this, I just pre-empted a little here.)
Run |
Oh and add a milestone - 5.10.0 please. |
Update the ExportDataEnvelope `state` enum to rely on an underlying `stateString`. This allows a default `unknown` value to be used if the state from the server is missing or doesn't match a value in the enum.
Updated to my proposed easy way of handling unknown states. Please take another look if you haven't already (there aren't changes since yesterday, I just wanted to make sure the tests would pass) and let me know if you have any questions/concerns! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea good call here, I can see this being a good general strategy for parsing enums from the server. Let's keep doing it.
📲 What
Update
ExportDataEnvelope
State
types to match the types defined by the server. These types were changed on the server, but our app was not updated to handle the new values. Also update related logic to be more readable.🤔 Why
Without this change, users are unable to request their personal data from the iOS app (unless they've previously successfully requested data before).
🛠 How
State
enum to match current fields defined by the server.canRequestData
helper everywhere it can be used and update method to returntrue
if the state isexpired
,none
, orfailure
.assembling
,assembled
, anduploading
) to determine if processing text/indicator should be shown.showPreparingDataAndCheckBackLaterText
topreparingDataAndCheckBackLaterTextHidden
to reflect how the field is used and to match current naming conventions.none
instead ofexpired
, since that's now the default for users who haven't requested their data before.unknown
state with corresponding test by parsing the server state as a string and manually translating it to the enum (usingunknown
if we don't find a match). This isn't a nice general solution, but since we're planning to update this to GraphQL soon, it's good enough until then.👀 See
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-07-24.at.12.22.59.mp4
✅ Acceptance criteria
⏰ TODO
unknown
) that will be used if the state provided by the server can't be parsed, but I'm not sure how to do this.