Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

delete/trash issue #3

Closed
seanpjanson opened this issue Jan 28, 2014 · 12 comments
Closed

delete/trash issue #3

seanpjanson opened this issue Jan 28, 2014 · 12 comments

Comments

@seanpjanson
Copy link

Hi, I am only bringing the SO discussions #21369573 and #21370636 here, so we do not vent it there. I installed this DEMO package and ran a few simple tests to see. The issue I mentioned on SO is showing with this DEMO as well. Steps to reproduce:
1/ Android device: "Create a file" ... creates "New file" in the root
2/ WEB browser: https://drive.google.com ... REMOVE (TRASH, DELETE...) the "New file"
3/ Android device: "List files with pagination" the list is unchanged, "New file" is showing.

Since this DEMO does not display the files' status, I ran the same (simplified) scenario in my test suite showing the file's "trashed" status, but did not get conclusive results.

Drive.DriveApi.query(mGAC, query).addResultCallback(new OnChildrenRetrievedCallback() {
@OverRide public void onChildrenRetrieved(MetadataBufferResult rslt) {
if (!rslt.getStatus().isSuccess()) return;
MetadataBuffer mdb = rslt.getMetadataBuffer();
for (int ii = 0; ii < mdb.getCount(); ii++) {
Log.i(TAG, (mdb.get(ii).isTrashed()?"-":"+")+mdb.get(ii).getTitle());
}
mdb.close();
}
});

Originally, the deleted file was showing as (+) (not trashed)
After I EMPTIED TRASH on the web, it changed status to (-) (trashed)
But when I re-ran the same test again (delete file, empty trash), I could not reproduce the same behavior. Conclusion: The trashed status (true/false, -/+) may be just random noise.
So, the behavior I would expect (after sync):
delete file on the web: The file/folder isTrashed() should change false -> true
recover file on the web: Change true -> false
empty trash - the file should not be listed anymore

This issue isn't a showstopper for me and I assume that it is just work-in-progress and it will be corrected eventually.
And the code Burcu's asking for is 0B1mQUW2aFJfdd2JTSkVIQnBoRm8.

@seanpjanson
Copy link
Author

update ... six hours later. Just FYI.
I started DEMO out of curiosity again, and the "New file" (created 6 hours ago, deleted, emptied from trash) is now GONE. GONE as not listed at all.
So, I created another one, deleted, removed from trash and it is still showing (10 minutes later) with trashed = false (alive) status. We'll see tomorrow.
BTW: In order to get the status reported, I locally changed one line of code in ResultsAdapter.java to show the status.
ResultsAdapter.java, line43:
titleTextView.setText(metadata.getTitle() +" "+(metadata.isTrashed()?"(trashed)":"(alive)"));

@seanpjanson
Copy link
Author

... another update. The last "New file" is GONE again. Elapsed time: about 1 hour since deletion. So, it may be some caching - timing - synchronization issue after all.
As a side note, it would be nice to name the files/folders using a construct like:
String fName = new SimpleDateFormat("yyMMdd-HHmmss",Locale.US).format(new Date())+".ext"
in order to get easily visible timestamp. Especially if Drive allows for multiple files with the same name.

@rakyll
Copy link
Contributor

rakyll commented Jan 29, 2014

@seanpjanson, it's the sync scheduling latency problem. Maybe we should add a force synchronizer that runs immediately and doesn't wait for Android to schedule and perform the next sync.

@seanpjanson
Copy link
Author

Yep, that's what I'm seeing. Do you want a narrated log of actions (last 6
hours or so). Not that it it's too useful, but if you follow the same path,
it may save you some time.
sean

On Wed, Jan 29, 2014 at 6:08 AM, Burcu Dogan notifications@github.comwrote:

@seanpjanson https://github.com/seanpjanson, it's the sync scheduling
latency problem. Maybe we should add a force synchronizer that runs
immediately and doesn't wait for Android to schedule and perform the next
sync.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-33582683
.

@rakyll
Copy link
Contributor

rakyll commented Jan 29, 2014

It'd be helpful if you share your log on a gist, I can also investigate whether there is something else going wrong.

@seanpjanson
Copy link
Author

It may not be an issue now, but since the latency is unpredictable and not
short (hours) it will pop-up as a problem when people start writing apps on
Andy and mess with files on Drive. After all, that's what Drive is all
about.
sean

On Wed, Jan 29, 2014 at 6:08 AM, Burcu Dogan notifications@github.comwrote:

@seanpjanson https://github.com/seanpjanson, it's the sync scheduling
latency problem. Maybe we should add a force synchronizer that runs
immediately and doesn't wait for Android to schedule and perform the next
sync.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-33582683
.

@seanpjanson
Copy link
Author

You caught me, I have no clue how to use gist, actually how to tie gist to
the issue. Can I stick it in github issue comments? It is only 20 lines (of
incoherent gibberish).

On Wed, Jan 29, 2014 at 6:16 AM, Burcu Dogan notifications@github.comwrote:

It'd be helpful if you share your log on a gist https://gist.github.com/,
I can also investigate whether there is something else going wrong.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-33583171
.

@rakyll
Copy link
Contributor

rakyll commented Jan 29, 2014

Yes, please add it as a comment here.

@seanpjanson
Copy link
Author

the DEMO code has 2 little modifications,

  • filenames are timestamps
  • there is (alive)/(trashed) flag added to the list of names

Mostly confirms what you already know, the only 'surprise'
was @4:53 AM, when restoring a file from trash apparently
updated the list (removing the 'deleted forever' in previous step)

2:23 AM 1/29/2014 created 140129-022003 , list shows:
140129-022003 (alive) OK
140128-195150.txt (trashed) OK (from yesterday - it is alive)
restored 140128-195150.txt

2:28 AM 1/29/2014
140129-022003 (alive) OK
140128-195150.txt (alive) OK

2:28 AM 1/29/2014 create file
140129-022845.txt (alive) the new file
140129-022003 (alive) OK
140128-195150.txt (alive) OK

2:30 AM 1/29/2014 delete 140129-022003
140129-022845.txt (alive) OK
140129-022003 (alive) WRONG
140128-195150.txt (alive) OK

2:54 AM 1/29/2014
140129-022845.txt (alive) OK
140129-022003 (trashed) OK
140128-195150.txt (alive) OK
deleting 140128-195150.txt
140129-022845.txt (alive) OK
140129-022003 (trashed) OK
140128-195150.txt (alive) WRONG

4:13 AM 1/29/2014 (elapsed 1:19)
140129-022845.txt (alive) OK
140129-022003 (trashed) OK
140128-195150.txt (trashed) OK
in TRASH, "delete forever" 140129-022003
140129-022845.txt (alive) OK
140129-022003 (trashed) WRONG
140128-195150.txt (trashed) OK

4:53 AM 1/29/2014
140129-022845.txt (alive) OK
140129-022003 (trashed) WRONG
140128-195150.txt (trashed) OK
restoring 140128-195150.txt
140129-022845.txt (alive) OK
140128-195150.txt (trashed) WRONG

6:07 AM 1/29/2014
140129-022845.txt (alive) OK
140128-195150.txt (alive) OK

As I said, probably nothing new.

On Wed, Jan 29, 2014 at 6:31 AM, Burcu Dogan notifications@github.comwrote:

Yes, please add it as a comment here.

Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-33584185
.

@seanpjanson
Copy link
Author

One last comment and I'll let you work.
I deleted my test file set yesterday (only moved it to trash, but left it there without emptying). This morning (10 hours later) I ran 'list' and could see everything ALIVE. Second run ( a minute later ) updated the status to TRASHED - correct status. No response required, just FYI.

@rakyll
Copy link
Contributor

rakyll commented Feb 5, 2014

@seanpjanson, we're making some modifications to make the syncing more instantly. Btw, you can call Drive.requestSync(...) to enforce immediate syncs.

@vitovalov
Copy link

Jun 2018 and still Filters.eq(SearchableField.TRASHED, false) is failing to find trashed items.
Even requestSync doesn't help. :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants