Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teams Link not opening #1373

Closed
nerumo opened this issue Aug 22, 2024 · 28 comments · Fixed by #1376 or #1378
Closed

Teams Link not opening #1373

nerumo opened this issue Aug 22, 2024 · 28 comments · Fixed by #1376 or #1378

Comments

@nerumo
Copy link

nerumo commented Aug 22, 2024

Describe the bug
I'm still having the issue describe in #1098. The Teams Webview is reloading as soon as I open the link and afterwards, the meeting isn't opened.

It happens with an already opened TFL and new TFL instances.

Expected behavior
I starts the meeting directly without reloading

Desktop (please complete the following information):

  • OS: Kubuntu 24.04
  • Installation package deb
  • Version 1.9.1

Debug

teams-for-linux msteams://teams.microsoft.com/l/meetup-join/19%3ameeting_YTBiNGFlYWItOTZmZC00YjUyLWIyMDEtZmE4NzRjNDY5NDdl%40thread.v2/0\?context\=%7b%22Tid%22%3a%225e2fa37d-0a53-49fb-a31a-0650e7079165%22%2c%22Oid%22%3a%22c321c62a-849b-4646-a261-04ca1d6a1058%22%7d --appLogLevels=error,info,warn,debug --webDebug
all good with appLogLevels you aren't using them
Initialising logger with config: "{}"
Logger initialised with transports: {}
08:36:44.989 › File logging at /home/marco/.config/teams-for-linux/logs/main.log with level silly
08:36:44.991 › Console logging enabled with level silly
08:36:44.991 › Logger initialised
08:36:44.991 › configPath: /home/marco/.config/teams-for-linux
08:36:44.991 › configFile: {
  optInTeamsV2: true,
  followSystemTheme: true,
  electronCLIFlags: [
    [ 'ozone-platform-hint', 'wayland' ],
    [ 'enable-features', 'WaylandWindowDecorations' ]
  ]
}
08:36:44.994 › Running under Wayland, switching to PipeWire...
08:36:44.995 › Adding electron CLI flag 'ozone-platform-hint' with value 'wayland'
08:36:44.995 › Adding electron CLI flag 'enable-features' with value 'WaylandWindowDecorations'
08:36:45.189 › processArgs: [
  '/opt/teams-for-linux/teams-for-linux',
  'msteams://teams.microsoft.com/l/meetup-join/19%3ameeting_YTBiNGFlYWItOTZmZC00YjUyLWIyMDEtZmE4NzRjNDY5NDdl%40thread.v2/0?context=%7b%22Tid%22%3a%225e2fa37d-0a53-49fb-a31a-0650e7079165%22%2c%22Oid%22%3a%22c321c62a-849b-4646-a261-04ca1d6a1058%22%7d',
  '--appLogLevels=error,info,warn,debug',
  '--webDebug'
]
08:36:45.190 › testing RegExp processArgs false
08:36:45.190 › testing RegExp processArgs false
08:36:45.190 › A url argument received with msteams protocol
08:36:45.191 › Testing network using net.request() for https://teams.microsoft.com/v2
08:36:45.192 › Spellchecker is disabled!
[49082:0822/083645.420111:ERROR:nss_util.cc(357)] After loading Root Certs, loaded==false: NSS error code: -8018
08:36:45.479 › Network test successful with method https
08:36:45.773 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'active'
08:36:46.322 › did-frame-finish-load {} true
08:36:46.322 › did-finish-load
08:36:47.695 › Badge count set to '0'
08:36:47.706 › Badge count set to '0'
08:36:48.616 › Badge count set to '0'
08:36:50.298 › Badge count set to '1'
08:36:50.503 › did-frame-finish-load {} false
08:36:50.745 › Badge count set to '10'

Additional context
It's interesting that the regex is working, but the webview is still reloading.

@IsmaelMartinez
Copy link
Owner

Hi @nerumo, thanks for reporting.

I can see your config file is like this:

{
  optInTeamsV2: true,
  followSystemTheme: true,
  electronCLIFlags: [
    [ 'ozone-platform-hint', 'wayland' ],
    [ 'enable-features', 'WaylandWindowDecorations' ]
  ]
}

Can you change it to be like this? The file should be under /home/marco/.config/teams-for-linux as the logs indicate.

{
  optInTeamsV2: true,
  url: https://teams.microsoft.com/v2,
  disableGpu: true,
  followSystemTheme: true,
  electronCLIFlags: [
    [ 'ozone-platform-hint', 'wayland' ],
    [ 'enable-features', 'WaylandWindowDecorations' ]
  ]
}

Note it should be JSON formatted so have the " on the keys and most values. I am on my phone, so a bit of a faff to reformat it (I can do It later)

@nerumo
Copy link
Author

nerumo commented Aug 22, 2024

I applied the config changes, it didn't change the behavior. I just realized that if I replace the msteams:// protocol with https://, the window will still reload (on existing instance), but the meeting opens.

Am I using the msteams:// protocol the wrong way? I just have the browser redirect extension, which replaces the protocol but without a special script to change it back.

@IsmaelMartinez
Copy link
Owner

Do you mind putting the logs? also... how good are you with regEx and/or programming? I think the regex for meetupJoinRegEx might not be fully correct and/or can be tweak to make this work, but looking at the logs would help.

In theory it should return the argument if it is https, otherwise it just replaces the 1st 8 characters with the url you got setup in the config. This is a bit weak IMO, and can be improved. Here the code

https://github.com/IsmaelMartinez/teams-for-linux/blob/80f14c0f3d17f28384337fa03399aa46460345a9/app/mainAppWindow/index.js#L214C24-L214C52

You could check replacing msteams:// for msteams:/ . If that works then we got a bugger in that area as both your work.

teams-for-linux msteams:/teams.microsoft.com/l/meetup-join/19%3ameeting_YTBiNGFlYWItOTZmZC00YjUyLWIyMDEtZmE4NzRjNDY5NDdl%40thread.v2/0\?context\=%7b%22Tid%22%3a%225e2fa37d-0a53-49fb-a31a-0650e7079165%22%2c%22Oid%22%3a%22c321c62a-849b-4646-a261-04ca1d6a1058%22%7d

The current regex looks like this ^https:\/\/teams\.(microsoft|live)\.com\/.*(?:meetup-join|channel), but that is only for the https part, not for the msteams: ones.

@joakim-tjernlund
Copy link

Does not work for me either. I have an link in the msg body:

https://teams.microsoft.com/l/meetup-join/19%3ameeting_OWFmZDg2NWQtMzYwYS00YWRhLTg5NzEtZjFkOGI...

Which I cannot click on, nothing happens when I do.
If I open the meeting in Evolution I can copy the link and paste it into my own chat in Teams.
There I can click on the link

@joakim-tjernlund
Copy link

^https://teams.(microsoft|live).com/.*(?:meetup-join|channel)

I wonder, should there be a .* at the end to match the full URL?

@joakim-tjernlund
Copy link

function onNewWindow(details) {
	console.debug(`testing RegExp onNewWindow ${new RegExp(config.meetupJoinRegEx).test(details.url)}`);
	if (new RegExp(config.meetupJoinRegEx).test(details.url)) {
		console.debug('DEBUG - captured meetup-join url');
		return { action: 'deny' };
	} else if (details.url === 'about:blank' || details.url === 'about:blank#blocked') {
		// Increment the counter
		aboutBlankRequestCount += 1;
		console.debug('DEBUG - captured about:blank');
		return { action: 'deny' };
	}

	return secureOpenLink(details);
}

I see the 'DEBUG - captured meetup-join url' and then there is an return { action: 'deny' }; ?

@ancwrd1
Copy link

ancwrd1 commented Aug 23, 2024

I have the same issue with the following links which are not opening externally:

https://teams.microsoft.com/l/channel/xxx6%40thread.tacv2/yyy?groupId=zzz&tenantId=

https://teams.microsoft.com/l/message/[email protected]/1724232560404?tenantId=yyyyyy&groupId=zzzzzz&parentMessageId=1724232560404&teamName=name&channelName=name&createdTime=1724232560404

The webview just reloads, but it is working when pasted in the chat and opened from there.

@IsmaelMartinez
Copy link
Owner

@ancwrd1, @nerumo and @joakim-tjernlund , I notice that I changed the default url to be the v2 version (opps).

Can you run the app with --url https://teams.microsoft.com ? I will try to revert that change in 1.9.3 (and release it soonish, but I suspect some of your problems will go away with it)

@IsmaelMartinez
Copy link
Owner

#1376 should hopefully fix this. Build on the go so I should have a pre-release ready soon.

@joakim-tjernlund
Copy link

@ancwrd1, @nerumo and @joakim-tjernlund , I notice that I changed the default url to be the v2 version (opps).

Can you run the app with --url https://teams.microsoft.com ? I will try to revert that change in 1.9.3 (and release it soonish, but I suspect some of your problems will go away with it)

That works(same as pasting URL into the chat) but one must first kill Teams

@joakim-tjernlund
Copy link

joakim-tjernlund commented Aug 23, 2024

I don't see how #1376 fixes this.

The problem is in onNewWindow as stated above. If you have a meet URL in your msg body it is simply denied.

@IsmaelMartinez
Copy link
Owner

I see the meeting invites are for teams v1 not v2, so I assumed you all are using teams v1... so revert it in https://github.com/IsmaelMartinez/teams-for-linux/releases/tag/v1.9.3

Then I realized that is not the case for most of you... so, 1.9.3 should fix it for the people that are still in teams v1, but not for people in v2.

@joakim-tjernlund
Copy link

joakim-tjernlund commented Aug 23, 2024

1.9.3 works! (sort of).
However, the meeting is opened in my external browser.
If I click on the same link in my chat window it is opened inside Teams-for-linux

I am in V2

@ancwrd1
Copy link

ancwrd1 commented Aug 23, 2024

Is it possible to stay on Teams v2 and still open meetings for v1?

@joakim-tjernlund
Copy link

1.9.3 works! (sort of). However, the meeting is opened in my external browser. If I click on the same link in my chat window it is opened inside Teams-for-linux

I am in V2

I was wrong, it is the same problem. I had set --meetupJoinRegExp to a dummy value!

Recap of my problem:
I have an invite with https link in the meeting msg area(Click Here to Join).
I see 'DEBUG - captured meetup-join url' when I click this link.
This debug msg comes from:

function onNewWindow(details) {
	console.debug(`testing RegExp onNewWindow ${new RegExp(config.meetupJoinRegEx).test(details.url)}`);
	if (new RegExp(config.meetupJoinRegEx).test(details.url)) {
		console.debug('DEBUG - captured meetup-join url');
		return { action: 'deny' };
	} else if (details.url === 'about:blank' || details.url === 'about:blank#blocked') {
		// Increment the counter
		aboutBlankRequestCount += 1;
		console.debug('DEBUG - captured about:blank');
		return { action: 'deny' };
	}

	return secureOpenLink(details);
}

which just returns ´action: deny´ and the link is ignored.

@IsmaelMartinez
Copy link
Owner

IsmaelMartinez commented Aug 23, 2024

@joakim-tjernlund , regarding the 'deny' stuff is a bit more complicated. Basically we need to deny in there as it is been handled in the main screen (otherwise it opens a new popup screen and the meeting in both places). You "might" be right but I am fairly sure that is there for a reason (from a long time) but it might not be needed anymore (?) really not sure. Feel free to open a MR with a change.

@ancwrd1 again, a bit more complicated as that area is already fairly complex. I would like to refactor it and make it simpler, but the amount of issues that get raised daily keeps me as busy as it gets.

@IsmaelMartinez
Copy link
Owner

ok, I think I found hte issue thanks to some logs in this other issue. Comment in #1370 (comment) but I will try to fix it next.

@ancwrd1
Copy link

ancwrd1 commented Aug 23, 2024

again, a bit more complicated as that area is already fairly complex. I would like to refactor it and make it simpler, but the amount of issues that get raised daily keeps me as busy as it gets.

No worries, as long as I can paste it in the own chat and open it's not a blocker for me anyway.

@joakim-tjernlund
Copy link

joakim-tjernlund commented Aug 23, 2024

@joakim-tjernlund , regarding the 'deny' stuff is a bit more complicated. Basically we need to deny in there as it is been handled in the main screen (otherwise it opens a new popup screen and the meeting in both places). You "might" be right but I am fairly sure that is there for a reason (from a long time) but it might not be needed anymore (?) really not sure. Feel free to open a MR with a change.

I am not sure either and what more that needs to be done. I wonder if I/you can create such invite ourself:
Create an non Online meeting, paste https://teams.microsoft.com/l/meetup-join/19%3ameeting_OWFmZDg2NWQtMzYwYS00YWRhLTg5NzEtZjFkOGIxYTk5ZWYw%40thread.v2/0....
into the msg area and add some other participant.

@IsmaelMartinez
Copy link
Owner

Sorry, the auto close issue can be annoying. Can you try https://github.com/IsmaelMartinez/teams-for-linux/releases/tag/v1.9.4 ?

@joakim-tjernlund
Copy link

1.9.4 did not solve my issue but that was expected I think.

@IsmaelMartinez
Copy link
Owner

@joakim-tjernlund , can you open another issue with your config file? I suspect your config file is pointing you to teams-v1 but your meeting links look like teams-v2 links, sometimes is good to re-use an issue for multiple people, if it is the same issue, but I think there are multiple issues in here, and the more there are the more difficult is to track each down.

@joakim-tjernlund
Copy link

@joakim-tjernlund , can you open another issue with your config file? I suspect your config file is pointing you to teams-v1 but your meeting links look like teams-v2 links, sometimes is good to re-use an issue for multiple people, if it is the same issue, but I think there are multiple issues in here, and the more there are the more difficult is to track each down.

I can open a new ticket but first: What config file?

@IsmaelMartinez
Copy link
Owner

ok, that tells me all 😄

Follow the template and your logs will tell you probably that you don't use a config file.

I suggest you then run the app with the following options:

teams-for-linux --optInTeamsV2 --url=https://teams.microsoft.com/v2 --logConfig={} --webDebug

The config options are here but I if you open the new ticket and put your logs after running that command, then I can give you a more tailored version of the config file you should have.

@IsmaelMartinez
Copy link
Owner

I might be wrong on you been in v2 by the way. Another user just mentioned they still in v1 but the meeting links seem to have changed.

The easiest way to know if you company is in v1 or v2, is to go to the https://teams.microsoft.com/ and login. If the url changes and adds the https://teams.microsoft.com/**v2** then you are in v2.

@joakim-tjernlund
Copy link

#1379

@IsmaelMartinez
Copy link
Owner

@ancwrd1 and @nerumo, this should be fixed for most cases (I think your cases), just use anything higher than 1.9.4 (1.9.5 just got promoted from pre-release to release).

Let me know if this isn't working for you, and we can dig further.

@nerumo
Copy link
Author

nerumo commented Aug 29, 2024

@IsmaelMartinez the msteams:// urls work now, you're my hero :) minor problem: webview is still reloading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment