New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 727207 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Blocking:
issue 499642



Sign in to add a comment

fileSystemProvider example generates a file of infinite length when copied

Project Member Reported by tetsui@chromium.org, May 29 2017

Issue description

Chrome Version: 61.0.3115.0
OS: ChromeOS

What steps will reproduce the problem?
(1) Install fileSystemProvider example extension from https://codesearch.chromium.org/chromium/src/chrome/common/extensions/docs/examples/api/fileSystemProvider/basic/
(2) Open FilesApp -> Add new services -> Sample File System
(3) Copy file1.txt in the Sample File System to Downloads directory.

What is the expected result?
FilesApp should recognize the end of the virtual file and generate a file of finite length.

What happens instead?
FilesApp did not recognize the end of the file and generated a file of infinite length with repeated content.

 

Comment 1 by tetsui@chromium.org, May 29 2017

Cc: mtomasz@chromium.org
Thanks for filing a bug. The example is wrong, as it doesn't take into account the offset.

Comment 3 by tetsui@chromium.org, May 29 2017

Thank you for taking a look. Just out of curiosity, I thought the extension should work as is because has_more argument of onReadFileRequested's onSuccess is set to false. Is the behavior of caller side expected?
hasMore doesn't mean that it's the end of the file. It only means that no more bytes will be returned for the request.

I agree that the documentation is not clear here.

Comment 5 by tetsui@chromium.org, May 29 2017

Status: Started (was: Assigned)
Oh, I understand that. Thank you for your help.
Project Member

Comment 6 by bugdroid1@chromium.org, May 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d0ee74f331d96323941af0cee83a2c789ad847be

commit d0ee74f331d96323941af0cee83a2c789ad847be
Author: tetsui <tetsui@chromium.org>
Date: Mon May 29 07:42:03 2017

Take into account options.offset in onReadFileRequested.

fileSystemProvider example extension did not take into account
options.offset in onReadFileRequested, which resulted in generating a
file of infinite length when the file is copied.

BUG= 727207 
TBR=rdevlin.cronin@chromium.org

Review-Url: https://codereview.chromium.org/2906283002
Cr-Commit-Position: refs/heads/master@{#475305}

[modify] https://crrev.com/d0ee74f331d96323941af0cee83a2c789ad847be/chrome/common/extensions/docs/examples/api/fileSystemProvider/basic/background.js

Comment 7 by tetsui@chromium.org, May 29 2017

Status: Fixed (was: Started)

Comment 8 by dchan@chromium.org, Aug 1 2017

Labels: VerifyIn-61

Comment 9 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment