Dependency resolution & processing issue
- Dominant language
- TypeScript
- Stars
- 48
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Hub filed a [bug](https://devtopia.esri.com/dc/hub/issues/400) concerning failed template deployments of `Solutions` containing `Hub Site Application` items with survey `Form` and `Feature Service` view dependencies. The issue can be observed when the same user owns all items.
* Solution ID: [39449a0fb37545079e749b7e6a9550b0](https://prod-pre-hub.maps.arcgis.com/home/item.html?id=39449a0fb37545079e749b7e6a9550b0)
* Hub Site Application ID: [44b0c4e8f0a0408cb222ef35f9e8a2e0](https://prod-pre-hub.maps.arcgis.com/home/item.html?id=44b0c4e8f0a0408cb222ef35f9e8a2e0)
The above `Hub Site Application` is a pared down site that embeds a single survey card (survey form dependency) and a single summary statistic card (survey stakeholder view dependency).
When a `Solution` is created for the `Hub Site Application`, the resulting templates reflect the following order & dependencies:
**Templates & dependencies:**
* site (deps: stakeholder, form)
* form (deps: stakeholder, fieldworker)
* stakeholder (deps: featureService, form)
* fieldworker (deps: featureService, form)
* featureService (deps: form)
Deploying the Solution fails when an `updateDefinition` XHR errors due to the derived build order prioritizing the creation of the fieldworker view before the source feature service and appears related to cyclical dependencies between the `Feature Service`s & `Form` items and how the dependency chain is walked/visited. The following is the resulting build order:
**Build Order:**
* fieldworker
* form
* featureService
* stakeholder
* site
However, the templates, dependencies & build order should probably more closely resemble something like (cyclical dependencies to `Form` removed):
**Templates & dependencies:**
* site (deps: stakeholder, form)
* form (deps: stakeholder, fieldworker)
* stakeholder (deps: featureService)
* fieldworker (deps: featureService)
* featureService (deps: none)
**Build Order:**
* featureService
* stakeholder
* fieldworker
* form
* site
When the cyclical dependencies from the `Feature Service`s to the `Form` are manually removed, the template deploys as expected. [Solution without cyclical deps](https://prod-pre-hub.maps.arcgis.com/home/item.html?id=0e5fde3df988458e83f6b488119b744f)
Contributor guide
Assessment
This issue has not been assessed yet.