Playcanvas-sync is not syncing, creating or removing files after first pull

Reproduce (pullAll):

  1. Follow the instruction on: https://github.com/playcanvas/playcanvas-sync or https://forum.playcanvas.com/t/tutorial-how-to-setup-playcanvas-sync-from-first-step-to-the-last-step/27455
  2. pull project with: pcsync.js pullAll
  3. Change a file remotely
  4. pull project again with: pcsync.js pullAll

We only get a change on the pcconfig.json file, which we did not change either locally or remotely.
It should also not be pulled or pushed as its in the pcignore.txt file. However, that is a separate issue.

pcignore.txt:

Reproduce (pushAll):

  1. Follow the instruction on: https://github.com/playcanvas/playcanvas-sync or https://forum.playcanvas.com/t/tutorial-how-to-setup-playcanvas-sync-from-first-step-to-the-last-step/27455
  2. pull project with: pcsync.js pullAll
  3. Change a file locally
  4. push project with: pcsync.js pushAll

Same issue as pullAll, no changed files are being pushed or synced to/with remote.

It seems not to be an issue with the pcconfig.json or .pcconfig files as the project is pulling the first time correctly. adding all the files to the local directory we indicated. Its only when we make a change and try to sync local with remote or vise versa.

We made a small change to the type-utils.js file by adding support for typescript sync.
We are adding the binary asset type to TEXTUAL_ASSET_TYPES in type-utils.js
and we also added 'binary':['.ts'], to TYPE_TO_EXT.

We find it a little bit weird that .ts files are being seen as binary files, however, I don’t believe that should break anything either locally or remotely in the project. Its just for making sure across developers we have the same files.

type-utils.js:
line 4 and 14.

Nevertheless, when we tried it with just Javascript files, not changing the type-utils.js code in any way, we still run into the indicated issue.

.pcconfig:

pcconfig.json in our project dir:

Any help would be appreciated :slight_smile:

Hmm, there’s nothing there that I see which strikes me as wrong.

Just to check, pulling the project down works fine but pushing doesn’t?

Can you try adding PLAYCANVAS_VERBOSE to 1 in the config as mentioned here: GitHub - playcanvas/playcanvas-sync: Real-time synchronization of files between PlayCanvas and your local machine

To get some extra logging.

Another thing to try for troubleshooting is to put all the config in the .pcconfig file and delete the folder’s pcconfig.json.

You may also want to look at the TS template I’ve setup with playcanvas-sync to see if an alternative setup works better for you: GitHub - playcanvas/playcanvas-editor-ts-template: A simple TypeScript template for PlayCanvas that can also sync with your playcanvas.com project

Oh wait, I think I see the issue.

pcignore.txt has the behaviour that in the Editor, it will ignore these matches during merges. For PlayCanvas sync, it is used to say, ONLY upload these files.

This was done to support a specific workflow where built code files caused long merges in PlayCanvas version control (it no longer does) and also, it was the only file to uploaded by playcanvas-sync.

I’ve personally found it easier to use the subdir property to separate the sync files from the NPM setup instead of using BAD FILE/DIR setup:

(See the TS template repo I posted earlier for an example).

2 Likes

Hi yaustar,

This fixed it thanks :slight_smile:

Just me not reading correctly, sorry

Cheers

1 Like