Page MenuHomePhabricator

Upload to Commons throwing error
Closed, ResolvedPublicBUG REPORT


Steps to replicate the issue (include links if applicable):
(This might not be an issue for accounts for few authorized user)

  • Login to your account.
  • Edit a video.
  • Preview it and wait until its finished.
  • Now, try to upload it to commons by clicking "Upload to Commons" button.
  • It will throw an error.

What happens?:

  • Throwing error on upload (For production)
  • The request for uploading is success with 200 status code due to upload.result variable in router-controller.js, its throwing error because it is limited to few users only. (For development)
  • The catch block have the key as success (Must be error) which leads to confusion for the data being posted.

What should have happened instead?:

  • We must put a condition before upload.result to check whether upload variable is defined or not. If it is undefined then we wouldn't run the loop where we have upload.result .
  • Change the success key word to error so that we get the preview message with error keyword rather than success keyword.

Software version (skip for WMF-hosted wikis like Wikipedia): Windows 11

Other information (browser name/version, screenshots, etc.):
Screenshot before fixing:

Screenshot 2023-03-25 201650.png (216×1 px, 38 KB)

image.png (389×1 px, 44 KB)

After fixing :

image.png (511×1 px, 41 KB)