gadget-inc/ggt

Files version mismatch

callmekatootie opened this issue · 1 comments

Error ID

0ce485d0-93bc-459f-93c0-6e8703bfcd4d

What happened?

I was trying out the ggt CLI and I first installed ggt globally using npm followed by ggt sync ./my-app-name --app my-app-name.

It seemed to work fine - I was able to open my own editor and view the files.

I did not make any changes. Within a few seconds, the CLI seemed to have crashed with the following error:

GGT_CLI_CLIENT_ERROR: An error occurred while communicating with Gadget

Gadget responded with the following error:

  Files version mismatch, expected 94 but got 102

What did you expect to happen?

the sync command to continue to function

Steps to reproduce

I am not sure if I can reproduce the error. I tried to, but I could not.

Anything else?

If it helps debugging, I went into the folder (containing my app code), and then ran command ggt sync. I received a message about everything in the .yarn/cache/* directory having changes. (Message was Local files have changed since you last synced).

I simply opted to Reset local files to remote ones.

This is a long standing issue that I've been trying to figure out.

TLDR: ggt sync attempted to send local files to Gadget, but your local files were out of date so Gadget denied the request.

Re-starting ggt sync will prompt you that both local and remote files have changed and ask you how you want to resolve them. Once resolved, ggt sync will continue to run as expected.


For more context, we have this concept of a "files version" which keeps track of the state of your Gadget application's files. Every time your files change, we increment your files version.

When ggt sync sends local files to Gadget, we send along your local files version and Gadget checks if the remote files version matches. If they don't match, you get this error:

Files version mismatch, expected {local files version} but got {remote files version}

We do this to prevent someone from overwriting their remote files with local ones that are out of date.

ggt sync is supposed to keep its local files version up to date with Gadget, but for some reason it falls behind and this error ends up occurring. I'm going to spend some time this week to try and figure out what's causing ggt sync to fall behind.