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

fix(gatsby): don't ignore SOURCE_FILE_CHANGED event #30127

Merged
merged 1 commit into from Mar 9, 2021

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Mar 9, 2021

Description

We are currently ignoring SOURCE_FILE_CHANGED event in reloadingData state. This seems to cause problems:

If we are in this state and we ignore that event, but

compiler.hooks.invalid.tap(`log compiling`, function () {
if (!webpackActivity) {
// mark webpack as pending if we are not in the middle of compilation already
// when input is invalidated during compilation, webpack will automatically
// run another compilation round before triggering `done` event
report.pendingActivity({ id: `webpack-develop` })
markWebpackStatusAsPending()
}
})

will mark webpack recompilation to run but it won't (until something else potentially in the future trigger another recompilation).

This might result in at least some runs getting stuck - GATSBY_DIAGNOSTIC_STUCK_STATUS_TIMEOUT reporting things like:

Activity "Building development bundle" of type "pending" is currently in state "NOT_STARTED"

This might also be source of at least some of double save issues

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 9, 2021
@pieh pieh added topic: state machine and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 9, 2021
@pieh pieh marked this pull request as ready for review March 9, 2021 10:32
Copy link
Contributor

@vladar vladar left a comment

Choose a reason for hiding this comment

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

It makes perfect sense to me.

I guess the only thing that confuses me a little bit - why did we ignore SOURCE_FILE_CHANGED in the first place there? Maybe there was some edge case?

@ascorbic
Copy link
Contributor

ascorbic commented Mar 9, 2021

I ignored it because previously we weren't using it to decide whether to recompile, we were just using it to decide whether to extract queries. As we were about to extract queries anyway, we didn't need to add a flag to say to do it

@pieh pieh added this to To cherry-pick in V2 Release hotfixes via automation Mar 9, 2021
@pieh pieh added this to To cherry-pick in V3 Release Hotfixes via automation Mar 9, 2021
@pieh pieh merged commit f6d1c09 into master Mar 9, 2021
@pieh pieh deleted the fix/dont-ignore-SOURCE_FILE_CHANGED branch March 9, 2021 10:59
pieh added a commit that referenced this pull request Mar 9, 2021
@pieh pieh moved this from To cherry-pick to Backport PR opened in V2 Release hotfixes Mar 9, 2021
vladar pushed a commit that referenced this pull request Mar 9, 2021
@vladar vladar moved this from To cherry-pick to Backport PR opened in V3 Release Hotfixes Mar 9, 2021
vladar pushed a commit that referenced this pull request Mar 9, 2021
(cherry picked from commit f6d1c09)

Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
@vladar
Copy link
Contributor

vladar commented Mar 9, 2021

Published in gatsby@3.0.4

This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants