Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@leosvelperez
Copy link
Member

Current Behavior

Sync generators are processed in the background by the daemon server. Their results are cached and reprocessed when the project graph is recomputed. There are currently two issues:

  • The cache is only invalidated after the project graph finishes recomputing, which means that there's an interval between files changed (triggering the project graph recomputation) and the recomputation finishes, where the cache is not invalidated, and it's stale. During that interval, any request to get the sync generator changes will use the stale cache.
  • Sync generators are scheduled to be processed after the project graph is recomputed, so a quick succession of recomputations can be coalesced. The problem is that the scheduled closure uses the project graph from the initial scheduling, rather than the latest available project graph at the time it runs. This results in the usage of stale data to process the sync generators.

Expected Behavior

Getting sync generators changes should always return up-to-date information.

@leosvelperez leosvelperez self-assigned this Dec 10, 2025
@leosvelperez leosvelperez requested a review from a team as a code owner December 10, 2025 10:42
@vercel
Copy link

vercel bot commented Dec 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Dec 15, 2025 2:57pm

@netlify
Copy link

netlify bot commented Dec 10, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 0862da5
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69402037995adb000875dcc1
😎 Deploy Preview https://deploy-preview-33780--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Dec 10, 2025

View your CI Pipeline Execution ↗ for commit 0862da5

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 7m 19s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 37s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-16 14:21:34 UTC

const { projects } =
readProjectsConfigurationFromProjectGraph(projectGraph);
// Fetch the latest graph instead of using the captured one which might be stale
const { projectGraph: latestGraph, error } =
Copy link
Collaborator

Choose a reason for hiding this comment

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

The projectGraph has been used plenty in this function... wouldn't those also be outdated? What is sending this function an outdated graph?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nevermind, I get it now

const { projects } =
readProjectsConfigurationFromProjectGraph(projectGraph);
// Fetch the latest graph instead of using the captured one which might be stale
const { projectGraph: latestGraph, error } =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nevermind, I get it now

@FrozenPandaz FrozenPandaz merged commit e377767 into master Dec 17, 2025
21 of 22 checks passed
@FrozenPandaz FrozenPandaz deleted the nxc-3474 branch December 17, 2025 15:36
@github-actions
Copy link
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants