Skip to content

Conversation

@tmarmer
Copy link
Contributor

@tmarmer tmarmer commented Jan 8, 2026

RFC

  • Update caching in the view resolver to remove any references to async nodes. Instead rely entirely on existing node-based cache and allow the update function to take in a set of node changes in addition to the existing.
  • Deprecate updateAsync from the View in favour of a markAsChanged in the ViewController that allows specific nodes to be marked as updated.
    • Changes were also made to batch the changes from node changes with data changes in case many changes are made in quick succession.
  • Update the async node plugin to use markAsChanged when an async node is updated
  • Add bench tests for the resolver.

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major
  • N/A

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Release Notes

  • Remove async node references from player core resolver.
  • Allow the resolver to update using node changes instead of just data changes
  • Add markAsChanged function to the ViewController to support triggering updates caused by node changes.
  • Update AsyncNodePlugin and AsyncNodePluginPlugin to make use of the above.
📦 Published PR as canary version: 0.14.2--canary.777.30429

Try this version out locally by upgrading relevant packages to 0.14.2--canary.777.30429

@tmarmer tmarmer requested a review from a team as a code owner January 8, 2026 17:30
@tmarmer tmarmer force-pushed the node-cache-updates branch from 79f5d12 to 5030f72 Compare January 15, 2026 18:38
@tmarmer tmarmer requested a review from a team as a code owner January 15, 2026 18:38
Comment on lines +735 to +743
private fun waitForCondition(
count: Int = 5,
delay: Long = 500,
conditions: () -> Boolean = { true },
) {
var counter = 0
while (!conditions() && counter++ < count) runBlockingTest { delay(delay) }
Assertions.assertTrue(conditions())
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes to the core that let async node changes get batched with other data changes means we need to wait after triggering an update since the view update is no longer triggered directly by calling the async node update function.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 92.77108% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.80%. Comparing base (2b9bd35) to head (6592d69).

Files with missing lines Patch % Lines
core/player/src/controllers/view/controller.ts 86.95% 3 Missing ⚠️
core/player/src/view/resolver/index.ts 89.47% 2 Missing ⚠️
plugins/async-node/core/src/index.ts 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
- Coverage   85.83%   85.80%   -0.03%     
==========================================
  Files         505      505              
  Lines       22794    22811      +17     
  Branches     2656     2657       +1     
==========================================
+ Hits        19565    19574       +9     
- Misses       2900     2908       +8     
  Partials      329      329              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

/** Map of async node id to promises being used to resolve them */
inProgressNodes: Set<string>;
/** node things */
nodeThings: Map<string, Node.Node>;
Copy link
Contributor

Choose a reason for hiding this comment

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

this definitely needs a better descriptor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, missed this when cleaning up the code, mb

];
}

public markAsChanged(nodes: Set<Node.Node>): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

if this is replacing updateAsync, we should make this method more clear on when it's supposed to be used

@tmarmer
Copy link
Contributor Author

tmarmer commented Jan 21, 2026

/canary

intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request Jan 21, 2026
@intuit-svc
Copy link
Contributor

intuit-svc commented Jan 21, 2026

Build Preview

Your PR was deployed by CircleCI #30429 on Thu, 22 Jan 2026 17:54:20 GMT with this version:

0.14.2--canary.777.30429

📖 Docs (View site)

@tmarmer
Copy link
Contributor Author

tmarmer commented Jan 22, 2026

/canary

intuit-svc added a commit to player-ui/player-ui.github.io that referenced this pull request Jan 22, 2026
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.

4 participants