multihack / multihack-brackets

Realtime collaboration for programmers. (Brackets Extension)
MIT License
24 stars 9 forks source link

Support syncing non-utf8 files #46

Open siphomateke opened 7 years ago

siphomateke commented 7 years ago

Non-text files such as images and fonts get corrupted on sync. Not sure if this is expected. Perhaps if it can't handle non-text files then it shouldn't attempt to sync them at all rather than corrupting them.

t-mullen commented 7 years ago

I've noticed this too. Will look into it.

t-mullen commented 7 years ago

Seems to be an issue with how Brackets handles non utf-8 encodings. Waiting on adobe/brackets#13518

t-mullen commented 7 years ago

Binary has no built-in binary file support, so I've moved to Node.js. Unfortunately this means we need to do an "initial write" with a different API (as Node can't do the replaceRanges that Brackets can). YJS is being tricky about this, so it'll take some time. :/

t-mullen commented 7 years ago

Some major changes are needed to add this "dual file type" syncing. It all feels very hacky and I'm seeing a lot of issues so I'd prefer to wait until Brackets supports binary files natively.

The next version will just ignore non-utf8 files. (They won't be synced). I don't think this will be that big of an issue, since you can't really "collaborate" on an image.

siphomateke commented 7 years ago

@RationalCoding That's unfortunate. I was actually going to suggest just ignoring non-utf8 files until then.

t-mullen commented 7 years ago

There is a new release of Brackets coming soon that updates the appshell, hopefully that fixes it.

t-mullen commented 6 years ago

Brackets improved their support in 1.10, so most files sync normally now. I still get a few "Unsupported Encoding" errors around .ico files, but for the most part things seem to be working (jpegs, pngs, fonts...)

I'm going to close this, since this proves any remaining errors are Bracket's fault.