apache / apache/cordova-common

Count increases by 1 in `ios.json` every time I build

Open
#241 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
42
Forks
45
Avg merge
5h 41m
Merged PRs (30d)
6

Description

- Recently, I added the following to my `config.xml` to enable file sharing within my app.

```xml



```

- This works fine. However, every time I build my app (`npm run prod`), a related `count` item within `platforms/ios/ios.json` increments by `1`. This appears to have no maximum value and will continue to grow as I build my app. I'm also not quite sure of its purpose.
- To note, other entries within this file also have a `count` item, but they remain at `1`.

```json
{
"config_munge": {
"files": {
"*-Info.plist": {
"parents": {
"UIFileSharingEnabled": [
{
"xml": "",
"count": 1 <-- 1, 2, 3... 999999999
}
]
}
}
}
}
}
```

- A bit of digging and I found the offending code, which led me to this repo. Any ideas why it might be doing this? Is it a bug or am I doing something wrong? Is it supposed to work like this? Any help would be much appreciated.

https://github.com/apache/cordova-common/blob/72aa215bdb3561073a39029738a4f87ecffa99d8/src/ConfigChanges/munge-util.js#L56

Contributor guide

Open the contributing guide

Research direction

Start at src/ConfigChanges/munge-util.js around line 56 and reproduce the issue with repeated npm run prod builds using the shown config.xml entry. Trace how the UIFileSharingEnabled config is merged into platforms/ios/ios.json; done means repeated builds leave the count stable, with the behavior verified against the reported JSON output.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
mobile-dev, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.