drive-cli icon indicating copy to clipboard operation
drive-cli copied to clipboard

Google Docs duplication during pull and push

Open nurdtechie98 opened this issue 6 years ago • 20 comments

When a file of google docs is pulled we need to export it to some other format. In doing so whenever we have pull, a new file in exported format is created even though there has been no changes since the last pull. Similarly while pushing this exported file gets pushed back as well thus causing duplication. This duplication must not happen.

nurdtechie98 avatar Apr 01 '19 03:04 nurdtechie98

@nurdtechie98 I want to solve this issue.

raghav-dalmia avatar Apr 08 '19 21:04 raghav-dalmia

@raghav-dalmia go ahead!

NightWing1998 avatar Apr 09 '19 05:04 NightWing1998

@nurdtechie98 @NightWing1998 can you please give a brief of this issue. I didn't understand what exactly the problem is. Does this happen only with google docs?

raghav-dalmia avatar Apr 09 '19 15:04 raghav-dalmia

Pinging @nurdtechie98.

inishchith avatar Apr 10 '19 04:04 inishchith

@nurdtechie98 @NightWing1998 can you please give a brief of this issue. I didn't understand what exactly the problem is. Does this happen only with google docs?

When you download a file for eg "sample"( word document ) that is a google doc ( .gdocx is the extension given by Google to such files ) it converts the file to .docx and then downloads it. If the repo inside which i'm pulling already has a sample doc in it then it creates a duplicate of it even though no changes were made to that file. Similarly it creates a duplicate when one tries to push such files.

NightWing1998 avatar Apr 10 '19 04:04 NightWing1998

Does this issue is only with doc?

raghav-dalmia avatar Apr 10 '19 06:04 raghav-dalmia

For Google sheet, ppt is it working fine?

raghav-dalmia avatar Apr 10 '19 06:04 raghav-dalmia

All types of google docs, i.e. , slides sheets docs etc

NightWing1998 avatar Apr 10 '19 06:04 NightWing1998

Wait for some time. I'll try to send some screenshots of what is happening Or if you want try to clone a Google doc/sheet/slide and use the push pull commands

NightWing1998 avatar Apr 10 '19 06:04 NightWing1998

ok, I will try.

raghav-dalmia avatar Apr 10 '19 13:04 raghav-dalmia

Screenshot 2019-04-10 at 8 29 09 PM Screenshot 2019-04-10 at 8 29 26 PM Refer to these screenshots You can see that when one downloads a google doc/sheet/ppt it successfully downloads it but when one tries to push it, it uploads the same as a separate file whereas it should have updated the google doc/sheet/ppt Also you can see that even if one downloaded the file it again creates a duplicate of it (.odt and .rtf) are 2 instances of the same file.

NightWing1998 avatar Apr 10 '19 15:04 NightWing1998

I have a solution for this issue, we can use google docs/google sheet/... api to update file content.

raghav-dalmia avatar Apr 10 '19 18:04 raghav-dalmia

I have a solution for this issue, we can use google docs/google sheet/... api to update file content.

@inishchith @NightWing1998 @nurdtechie98 comment on this. If you have another idea please discuss.

raghav-dalmia avatar Apr 11 '19 17:04 raghav-dalmia

@raghav-dalmia I didn't get much time to think and consider alternatives. I'd suggest you work the solution ( in case you're clear with it) and later we can have a discussion over the PR. Else i'll update this thread once i get time.

Thanks for your patience

inishchith avatar Apr 12 '19 17:04 inishchith

@inishchith I will wait of your (@NightWing1998 @nurdtechie98 @inishchith ) reply. When you got time please update this thread. Thank you

raghav-dalmia avatar Apr 14 '19 21:04 raghav-dalmia

@raghav-dalmia your approach looks good to me feel free to go ahead

nurdtechie98 avatar Apr 15 '19 05:04 nurdtechie98

@nurdtechie98 @inishchith don't you think if we use more G-suite APIs, it will slow down our code. There should be another alternative.

raghav-dalmia avatar May 04 '19 20:05 raghav-dalmia

It might take some time, agreed but do we have any other alternative. Let me know if you can think of something good.

nurdtechie98 avatar May 05 '19 12:05 nurdtechie98

Another alternative could be track the files that were converted and then downloaded and while pushing back change the extension back to what it was. For eg if one has downloaded text.gdoc as text.docx then while pushing update change the extension back to .gdoc and then push. But not sure if it will work

NightWing1998 avatar May 05 '19 13:05 NightWing1998

Sorry for the late reply, I am busy with my exams. @NightWing1998 your idea seems good to me. @nurdtechie98 @inishchith please comment.

raghav-dalmia avatar May 26 '19 15:05 raghav-dalmia