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-telemetry): reduce save to config #32260

Merged
merged 1 commit into from
Jul 6, 2021

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Jul 6, 2021

Description

We write machineId to disk every time we try to request it, even if it's already there.
On windows I get

Error: EPERM: operation not permitted, rename '<HOME>.config\gatsby\config.json.2888574204' -> '<HOME>.config\gatsby\config.json'
    at Object.renameSync (fs.js:772:3)
    at Function.writeFileSync [as sync] (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\write-file-atomic\index.js:244:8)
    at Configstore.set all [as all] (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\configstore\index.js:61:20)
    at Configstore.set (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\configstore\index.js:91:12)
    at EventStorage.updateConfig (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\gatsby-telemetry\lib\event-storage.js:124:24)
    at AnalyticsTracker.getMachineId (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\gatsby-telemetry\lib\telemetry.js:335:16)
    at new AnalyticsTracker (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\gatsby-telemetry\lib\telemetry.js:76:27)
    at Object.<anonymous> (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\gatsby-telemetry\lib\index.js:37:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (<ROOTDIR>gatsby\tmp\gatsby-tmp-ssr\node_modules\gatsby\src\redux\index.ts:10:1)

Documentation

Related Issues

@wardpeet wardpeet added the topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine) label Jul 6, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 6, 2021
@wardpeet wardpeet removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jul 6, 2021
@LekoArts LekoArts added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jul 6, 2021
@gatsbybot gatsbybot merged commit bb29394 into master Jul 6, 2021
@gatsbybot gatsbybot deleted the fix/multi-update-telemetry branch July 6, 2021 13:28
vladar pushed a commit that referenced this pull request Jul 6, 2021
gatsbybot pushed a commit that referenced this pull request Jul 6, 2021
(cherry picked from commit bb29394)

Co-authored-by: Ward Peeters <ward@coding-tech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: core Relates to Gatsby's core (e.g. page loading, reporter, state machine)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants