Skip to content
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

Conflicting Info.plist merge strategies #378

Closed
britzl opened this issue May 9, 2024 · 0 comments · Fixed by #380
Closed

Conflicting Info.plist merge strategies #378

britzl opened this issue May 9, 2024 · 0 comments · Fixed by #380
Assignees

Comments

@britzl
Copy link
Contributor

britzl commented May 9, 2024

There's a problem when merging Info.plists where the expected result is different depending on which type of key that is merged.

Case 1 - merging array of dictionaries with SKAdNetworkItems

PLIST 1

    <plist version="1.0">
        <dict>
            <key>SKAdNetworkItems</key>
            <array>
                <dict>
                    <key>SKAdNetworkIdentifier</key>
                    <string>7UG5ZH24HU.skadnetwork</string>
                </dict>
            </array>
        </dict>
    </plist>

PLIST 2

    <plist version="1.0">
        <dict>
            <key>SKAdNetworkItems</key>
            <array>
                <dict>
                    <key>SKAdNetworkIdentifier</key>
                    <string>ECPZ2SRF59.skadnetwork</string>
                </dict>
            </array>
        </dict>
    </plist>

The expected merge of the SKAdNetworkItems is one array with the two SKAdNetworkIdentifier fields:

EXPECTED

    <plist version="1.0">
        <dict>
            <key>SKAdNetworkItems</key>
            <array>
                <dict>
                    <key>SKAdNetworkIdentifier</key>
                    <string>ECPZ2SRF59.skadnetwork</string>
                </dict>
                <dict>
                    <key>SKAdNetworkIdentifier</key>
                    <string>7UG5ZH24HU.skadnetwork</string>
                </dict>
            </array>
        </dict>
    </plist>

Case 2 - merging array of dicts with CFBundleURLTypes

PLIST 1

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb7886788786688</string>
            </array>
        </dict>
    </array>

PLIST 2

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>

            <key>CFBundleURLName</key>
            <string>REVERSED_CLIENT_ID</string>
            
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.fjdkdknvhgjfd</string>
            </array>
        </dict>
    </array>

In this case we expect ONE new merged entry:

EXPECTED

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>

            <key>CFBundleURLName</key>
            <string>REVERSED_CLIENT_ID</string>
            
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.fjdkdknvhgjfd</string>
                <string>fb7886788786688</string>
            </array>
        </dict>
    </array>

The current code handles the second case, not the first one. How are we going to deal with this? Should we have a list of keys which should be merged according to the first case, and default to a "deep merge" as in case 2?

@britzl britzl self-assigned this May 9, 2024
@AGulev AGulev linked a pull request Jun 12, 2024 that will close this issue
@AGulev AGulev removed a link to a pull request Jun 12, 2024
@AGulev AGulev linked a pull request Jun 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant