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.

Weird Behavior after a series of calls

See original GitHub issue

Hello, I’m facing a weird behavior of the Uppy.XHRUpload component.

I have a simple code that upload a series of images one at a time, the code is the following

function UploadImages() {
	var files = fileUploader.getFiles();

	fileUploader.setMeta({ __RequestVerificationToken: $("input[name=__RequestVerificationToken]").val() });

	if (files.length > 0) {
		fileUploader.use(Uppy.XHRUpload, {
			endpoint: '/{0}/propertyimages/submit/{1}'.format(countryRoute, idProperty),
			timeout: 0,
			fieldName: 'propertyImage',
			limit: 1,
			validateStatus: function (statusCode, responseText, response) {
				return jQuery.parseJSON(responseText).Success;
			}
		});

		fileUploader.on('complete', (result) => {
			if (result.failed != null && result.failed.lenght > 0)
				ShowWarningNotification(ValidationResources.Error_PropertySubmittedTitle, ValidationResources.Error_PropertySubmittedMessage);

			ShowFinalStep();
		});

		fileUploader.upload();
	}
	else {
		ShowFinalStep();
	}
}

After a series of calls (randomly) the component changes the behavior from an XHR call to a multipart/form-data without apparent reason and this makes all the following calls to fail.

Here the screenshot of the calls: https://ibb.co/nCfstLZ

Any reason for this behavior?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ollie10commented, Jul 30, 2020

Thanks, at the end was a problem of the token that I was passing to the page not of the upload! Solved so!

0reactions
ollie10commented, Jul 30, 2020

Feel free to delete this whole post to not cause other users caos while looking something similar, cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strange phone behavior after someone call…
"Strange phone behavior after someone called me on WhatsApp for 4 hours straight I know this person in real life and didn't want...
Read more >
Oppositional Defiant Disorder (ODD): Symptoms & Treatment
Oppositional defiant disorder (ODD) is a condition in which your child displays a pattern of uncooperative, defiant and angry behavior ...
Read more >
Behavior - unusual or strange - UF Health
Unusual or strange behavior involves performing actions that are not normal for the person. ... Call your health care provider if.
Read more >
Switch call to this device from call queues weird behavior on ...
1. Have user login to RingCentral mobile app on iOS. 2. Have user set status to Available and toggle ON the setting to...
Read more >
Personality Change: Causes, Diagnosis & Treatments
However, some people experience unusual or strange behavior for years, which may occur due to an illness or injury.
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