MicrosoftDocs / msteams-docs

Source for the Microsoft Teams developer platform documentation.
https://aka.ms/teamsdev
Creative Commons Attribution 4.0 International
284 stars 506 forks source link

Downloading files in new teams from a custom teams app (teams toolkit) #9904

Open KristapsD opened 11 months ago

KristapsD commented 11 months ago

Hello!

Using classic teams i can download files from a custom teams app without issues - when the app first loads, and after already multiple other downloads.

However, when switching over to new teams, i can only do one download after the app loads, and after the initial download it doesn't do any more downloads.

Creating a new local custom app and adding 1 button with an onClick function: var a = document.createElement("a"); a.href = window.URL.createObjectURL(new Blob(["CONTENT"], {type: "text/plain"})); a.download = "demo.txt"; a.click(); Allows me to repro this issue.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

sayali-MSFT commented 11 months ago

Hello @KristapsD - Thanks for raising your query. Could you please share the complete code snippets so that we can try to repro it from our end. Also, let us know whether you have created a Tab or a bot in Teams?

Also, let us know on which Teams client(Desktop/Web/Mobile) you are trying it?

KristapsD commented 11 months ago

@sayali-MSFT - here is my Teams version: image

I've just created a completely new teams app (through teams toolkit) and ran it, the only code i changed was in src > components > tab.tsx This is the tab.tsx file

import { useContext } from "react";
import { Welcome } from "./sample/Welcome";
import { TeamsFxContext } from "./Context";
import config from "./sample/lib/config";

const showFunction = Boolean(config.apiName);

export default function Tab() {
  const { themeString } = useContext(TeamsFxContext);

  const testDownload = () => {
    var a = document.createElement("a");
    a.href = window.URL.createObjectURL(new Blob(["CONTENT"], {type: "text/plain"}));
    a.download = "demo.txt";
    a.click();
  }

  return (
    <div
      className={themeString === "default" ? "light" : themeString === "dark" ? "dark" : "contrast"}
    >
      <button onClick={testDownload}>Test Download</button>
    </div>
  );
}

These were the setup options:

  1. New project: Tab
  2. App features Using a Tab: React with Fluent UI
  3. Programming Language: TypeScript
  4. Workspace folder: default
  5. Application name: minReproDownload

If you wish i can upload this project to a repository and share it with you.

As for the clients i've had this issue appear in: Only the new teams Desktop client - through browser it works, and on the old Teams Desktop client it also works, I have not tried it through mobile client

sayali-MSFT commented 11 months ago

@KristapsD -Yes sure, please share the repository so that we can try and raise the bug accordingly.

KristapsD commented 11 months ago

@sayali-MSFT Here's the repo: https://github.com/KristapsD/minReproDownload

SaiPratap-MSFT commented 11 months ago

@KristapsD - We have tried to replicate the scenario from our side. We were successful in downloading the file multiple times in both new teams and classic teams. I have attached a video for reference. Are you trying the same?

https://github.com/MicrosoftDocs/msteams-docs/assets/146196379/ce18d465-9e46-40ac-8aa8-c447ead73aec

KristapsD commented 11 months ago

@SaiPratap-MSFT That's through the website version is it not? Through a website it also downloads for me properly, but whenever i sideload the local app to the desktop client and try to download multiple times there - it fails. Attached a video: only one time

And heres my current teams version: image

SaiPratap-MSFT commented 11 months ago

@KristapsD - We have tested this scenario on Desktop as well and it working fine. Could you please share the console error so that we can investigate from our end. I have attached a video for reference.

https://github.com/MicrosoftDocs/msteams-docs/assets/146196379/44976e76-5464-4654-9c6c-177a9cb22ba9

KristapsD commented 11 months ago

@SaiPratap-MSFT How do i get the console error from the desktop application? Is it just collecting the support files?

SaiPratap-MSFT commented 11 months ago

@KristapsD - you can refer this doc

KristapsD commented 10 months ago

@SaiPratap-MSFT Sorry for asking for help again - but the developer preview was enabled following the doc you provided, and i can see it in the old teams. But i can't seem to find it new teams?

SaiPratap-MSFT commented 10 months ago

@KristapsD - We have raised a bug for your issue. We will inform you once we get any update.

KristapsD commented 10 months ago

@SaiPratap-MSFT Any news for the issue? Or is it still being worked on?

SaiPratap-MSFT commented 10 months ago

@KristapsD - We are checking your query with engineering team and let you know once we get any updates from them.

Thanks

makwanam commented 8 months ago

Hi @KristapsD, where you able to figure out any solution for this issue? We have our teams tab app project running into the exact same issue. As you have mentioned, when running the Tab App inside the browser version of Teams, the download works fine i.e., able to download multiple files, etc. But when running the Teams Tab app inside the newer version of Teams Desktop client, the download seems to fail after the first one! Downloading multiple files together do not work.

Note: If we switch back to the older Teams Desktop client then the download is working fine from our Teams Tab app (doesn't matter if downloading single/multiple files together).

Hi @sayali-MSFT @SaiPratap-MSFT, please let us know if there is any update on this! Thanks!

ChetanSharma-msft commented 8 months ago

Hello Everyone- We are actively checking the bug status with engineering team and let you know the updates, if any.

takeungrae commented 8 months ago

아직도 버그를 추적중입니까? 저 또한 동일한 증상이 있습니다!!

takeungrae commented 8 months ago

Have you solved this problem? I too have the same problem.

Meghana-MSFT commented 7 months ago

We do not have any ETA to share. We are checking the bug status with engineering team and let you know the updates, if any.

ndking82 commented 6 months ago

In the New Teams client, enter the Test Teams app you created above and click the Download Files button. You can then verify that the file is initially downloaded, and that other files that remain thereafter are not downloaded. Even if you check the download folder, you can see that only a few of the three docx files have been downloaded. You can then click the Download Files button again to confirm that there is no response.

Once this happens, the New Teams app continues to download only once, even if you completely shut down and run it again. And what's unusual is that in that situation, you can download it for the first time if you open a new window with the Open Conversation in a new window function in a specific message on the team channel and use the Custom Teams app in it. A temporary way to break this situation is to initialize the Teams app in the Settings app, but as mentioned above, if you try to download another file when the existing file is not complete, the same problem will recur again.

It seems to be a problem with NewTeams' built-in web browser WebView 2. When will it be patched so that it can be processed normally? Or is there a solution?

KristapsD commented 5 months ago

Hello everyone!

Today when opening teams i'm greeted with this message: image

Obviously meaning that on the first of july me and my other colleagues will be forced on the new teams, where we will encounter the discussed issue.

Is there still no ETA on this being fixed? As i can see im not the only person with this issue aswell.

Meghana-MSFT commented 5 months ago

We are continuously following up with the engineering team. We will keep you posted once the fix has reached public rings.

gunesy1 commented 4 months ago

I have the same problem, I can only download a file once, I cannot download the second file. This happens only with new teams. Waiting for the solution.

ChetanSharma-msft commented 4 months ago

Hello Everyone, Engineering team has fixed the bug internally and we will let you know once it is released publicly.

Muthukumar230195 commented 4 months ago

Hi @ChetanSharma-msft, @Prasad-MSFT, @Meghana-MSFT,

We are experiencing the same issue with multiple PDF downloads in the new Teams desktop client. The downloads only work when the app is loaded for the first time. Could you please let us know when we can expect this fix to be released publicly?

Thanks.

KristapsD commented 3 months ago

Hello!

July 1st has come and our tenant has been forcefully pushed over to the new teams. The issue is still not resolved.

What now?

abhi-mobi commented 2 months ago

We are also facing similar issue, does changing Teams SDK will solve this issue?