Skip to content

Add support for syncing all file types for both pcwatch and pcsync#72

Open
tatelax wants to merge 6 commits into
playcanvas:mainfrom
tatelax:feature/handle-binary-files
Open

Add support for syncing all file types for both pcwatch and pcsync#72
tatelax wants to merge 6 commits into
playcanvas:mainfrom
tatelax:feature/handle-binary-files

Conversation

@tatelax

@tatelax tatelax commented Jul 7, 2025

Copy link
Copy Markdown
  • Adds binary file support for pcwatch
  • Adds -a & --all argument to sync changes of all file types to and from PlayCanvas for both pcwatch and pcsync

@willeastcott willeastcott left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution. I think someone else should also cast an eye. @kpal81xd, can you also do a review pass before we merge please?

@tatelax

tatelax commented Jul 14, 2025

Copy link
Copy Markdown
Author

Sometimes this error is thrown:

/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/utils/common-utils.js:179
            return md5 === remote.file.hash;
                                       ^

TypeError: Cannot read properties of null (reading 'hash')
    at Object.sameHashAsRemote (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/utils/common-utils.js:179:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ComputeDiffAll.handleFileOnBoth (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/sync-commands/compute-diff-all.js:97:28)
    at async Promise.all (index 49)
    at async ComputeDiffAll.handleAllFiles (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/sync-commands/compute-diff-all.js:83:9)
    at async ComputeDiffAll.run (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/sync-commands/compute-diff-all.js:40:9)
    at async reportDiffAll (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/sync-commands/sync-utils.js:10:19)
    at async Object.wrapUserErrors (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/utils/common-utils.js:112:20)
    at async Object.compareAndPrompt (/Users/tatemccormick/Documents/Projects/playcanvas-sync/src/sync-commands/sync-utils.js:34:19)

@tatelax

tatelax commented Jul 14, 2025

Copy link
Copy Markdown
Author

Just pushed an issue that fixes this. One of the util files assumed that a download was a file.

Also, I fixed an issue where pulling changes showed many missing files/directories on local that exist on remote. What actually is happening is that PlayCanvas handles some files as directories (fbx, glb, etc.) but when you download them via API, they download as files.

@tatelax

tatelax commented Jul 16, 2025

Copy link
Copy Markdown
Author

TODO: Deleting local files that have already been deleted on remote causes crash

@kpal81xd kpal81xd left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Left a couple comments for layout but otherwise looks good nice 🙂

Comment thread package.json Outdated
Comment thread src/sync-commands/compute-diff-all.js Outdated
@tatelax

tatelax commented Jul 17, 2025

Copy link
Copy Markdown
Author

TODO: Deleting local files that have already been deleted on remote causes crash

Pushed a fix for this: fabc1a8

@tatelax

tatelax commented Jul 17, 2025

Copy link
Copy Markdown
Author

#73

I agree with this issue. This PR could include this change. It's a bit confusing to run pcsync pullAll --all.

…eting files calls WatchUtils.reportWatchAction() now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants