Skip to content

CB-13496: Fix greedy regex in plist-helpers - #45

Merged
dpogue merged 1 commit into
apache:masterfrom
dpogue:plist-helper
Sep 11, 2018
Merged

CB-13496: Fix greedy regex in plist-helpers#45
dpogue merged 1 commit into
apache:masterfrom
dpogue:plist-helper

Conversation

@dpogue

@dpogue dpogue commented Sep 6, 2018

Copy link
Copy Markdown
Member

Platforms affected

iOS

What does this PR do?

Resolves an issue where a regex was overly greedy when comparing plist entries for merging and could result in collapsing several of them into a single entry.

What testing has been done on this change?

Added a test that fails with current master and passes with this change, based on the details provided by @knight9999 in the JIRA bug. It sounds like this might be the cause of GH-44 as well (/fyi @donnie-jp).

Now, my fix assumes that we're always looking for $(something) and not just $something, which might not be a safe assumption. Unfortunately I'm not well-versed enough in iOS stuff to know :(

Checklist

  • Reported an issue in the JIRA database
  • Commit message follows the format
  • Added automated test coverage as appropriate for this change.

@dpogue
dpogue requested a review from knight9999 September 6, 2018 06:47
@codecov-io

codecov-io commented Sep 6, 2018

Copy link
Copy Markdown

Codecov Report

Merging #45 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #45   +/-   ##
=======================================
  Coverage   86.24%   86.24%           
=======================================
  Files          19       19           
  Lines        1730     1730           
  Branches      360      360           
=======================================
  Hits         1492     1492           
  Misses        238      238
Impacted Files Coverage Δ
src/util/plist-helpers.js 81.39% <100%> (ø) ⬆️

Continue to review full report at Codecov.

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

@dpogue

dpogue commented Sep 6, 2018

Copy link
Copy Markdown
Member Author

#44 says that their problem is related to the same JIRA ticket

@knight9999 knight9999 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good.
In the future I think we should find a way to distinguish the placeholder (i.e. variable with $ prefix) in cordova plugin.xml and the placeholder in xcode plist. For example, introducing escape character.

@donnie-jp

Copy link
Copy Markdown

@dpogue / @knight9999 - thanks for getting this PR through so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants