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.

JSDoc types of the GetTemporaryLinkResult interface are not updated

See original GitHub issue

Describe the bug I’m calling:

const operationResult = await dbx.filesGetTemporaryLink({
	path: `/${CONFIG_STORAGE.uploader.assetsPath}/${fileUUID}`
});

which is supposed return a promise of GetTemporaryLinkResult interface:

09_081126

But in fact it returns something else:

09_081009

That’s why IDE returns a warning regarding the status field of GetTemporaryLinkResult.

To Reproduce

const _dropboxFactory = function _dropboxFactory() {

	const dbx = new Dropbox({
		accessToken: CONFIG_STORAGE.apiToken
	});

	return dbx;

};

export const fileDownload = async function fileDownload(fileUUID) {

	const dbx = _dropboxFactory();

	try {

		const operationResult = await dbx.filesGetTemporaryLink({
			path: `/${CONFIG_STORAGE.uploader.assetsPath}/${fileUUID}`
		});

		if ("OK" === http.STATUS_CODES[operationResult.status].toUpperCase()) {…}

	} catch (err) {…}

};

Expected Behavior JSDoc/types should be updated in accordance with the design de facto.

Actual Behavior The GetTemporaryLinkResult typing documentation seems to be outdated comparing to what comes in fact out of filesGetTemporaryLink({…}).

09_081048

Versions

  • What version of the SDK are you using? 7.0.0
  • What version of the language are you using? JS 2020
  • Are you using Javascript or Typescript? JS
  • What platform are you using? (if applicable) Node.js

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rogebrdcommented, Oct 22, 2020

No, unfortunately that wouldn’t fix that bug. I have added that to my list of things to take a look at though so hopefully a fix should be out soon.

0reactions
pubmikebcommented, Nov 2, 2020

@greg-db, thanks a lot, the warning is gone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSDoc Reference - TypeScript: Documentation
JSDoc Reference. The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >
Use JSDoc: @type
The @type tag allows you to provide a type expression identifying the type of value that a symbol may contain, or the type...
Read more >
Support JSDoc type information · Issue #514 · microsoft/vscode
Below a JSDOC comment which does not show properly in document type javascript. // Interface new functions /** * @param {Object} to *...
Read more >
how to use interfaces with jsdoc? - typescript - Stack Overflow
Typescript doesn't support defining interfaces via JSDoc. But you can use an object type in your @param :
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