question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fileSystem.retainEntry() incorrectly passed a callback?

See original GitHub issue

The chrome.fileSystem.retainEntry() API does not take a callback. I am seeing chromep fail when calling this method, as Chrome appears to be doing some schema checking. I can’t find anything about where this happens, and I should be able to work around it, but it seems like chromep should be aware of this.

E.g. consider this code:

var id = chromep.fileSystem.retainEntry(entry);

At this point I would expect id to be a string. Instead it is a rejected Promise. From the console:

Promise {[[PromiseStatus]]: "rejected",
 [[PromiseValue]]: Error: Invocation of form fileSystem.retainEntry(object, function) doesn't match definition fileSystem.retainEntry(object entry)}

Is this expected? Is it something else about my environment that is interfering with things? Or perhaps a bug?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tfoxycommented, Apr 11, 2017

Yeah, I will add a warning to the readme tomorrow.

It would be great if this library can be a total replacement of chrome, so I will leave this open for now.

0reactions
srsudarcommented, Mar 19, 2018

Unfortunate but seems reasonable, especially with the update to the README. Your example of using chrome/chromep is nice and clean.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are my callback functions executing in the wrong order?
It looks like you've misunderstood the idea of callbacks. The idea is that you pass a function as an argument to another function,...
Read more >
JavaScript Callbacks Variable Scope Problem - Pluralsight
In this free JavaScript guide, you'll learn how to fix the common JavaScript callbacks variable scope problem. This step-by-step JavaScript ...
Read more >
FileSystemFileEntry.file() - Web APIs - MDN Web Docs
A callback function which is called when the File has been created successfully; the File is passed into the callback as the only...
Read more >
Callbacks / Callables - Manual - PHP
A PHP function is passed by its name as a string. Any built-in or user-defined function can be used, except language constructs such...
Read more >
Don't use functions as callbacks unless they're designed for it
What you are experiencing is the poor design of the JavaScript base library. Whoever designed map() to pass all these extra arguments should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found