fix(import): find the export XML whatever iOS named it - #1009
Merged
Merged
Conversation
The archive member was matched against the English lowercase spelling alone. iOS writes that file name in the phone's language and some versions capitalise it, so an ordinary export could arrive as Export.xml or a translated name and was refused with a message telling the reader their export was invalid. The basename now matches in any capitalisation, and a single XML member at the top of the archive is taken as the translated spelling. Apple's clinical-document file never qualifies: it sits beside the real export and would parse to nothing. When no member qualifies the error lists the XML members the archive does hold, so the next report arrives with the answer in it. Refs #1008
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Apple Health import matched its archive member against the English lowercase
export.xmlalone. iOS writes that name in the phone's language and some versions capitalise it, so a perfectly normal export could arrive asExport.xmlor translated and was refused with "Archive is missing the apple_health_export/export.xml member". Reported in #1008.The basename now matches in any capitalisation, and a single top-level XML member is accepted as the translated spelling.
*_cda.xmlis never taken: Apple ships that clinical-document file beside the real export. When nothing qualifies, the error lists the XML members actually present.