jmshrv / finamp

A Jellyfin music client for mobile
Mozilla Public License 2.0
1.83k stars 122 forks source link

[Bug] Only one finamp app client can connect per user. #870

Open BaccanoMob opened 1 week ago

BaccanoMob commented 1 week ago

I got a phone and a tab. I try to login with quick connect due to SSO plugin.

After I login with quick connect with both devices, the first device automatically disconnects. Jellyfin allows only a single device connect via the app unlike chrome browser logins.

Also tried with 0.9.8 with one device and 0.9.9 in another which didn't work either. The stable release doesn't have quick connect feature to test out.

Not sure if this will persist with desktop variants with quick connect (will need windows version to test out).

BaccanoMob commented 1 week ago

Just tested with a dummy user (user/password). Logged in one device with username and password and other with quick connect. First device logged out (both with dummy user).

One login with dummy user and other with quick connect from my account works (workaround)

Chaphasilor commented 1 week ago

Hmm, that's strange. Does the same happen if you use the Jellyfin Android app (with and without Quick Connect)?

Also, how does the "devices" page look like on your server? Do the devices have different names?

BaccanoMob commented 1 week ago

Screenshot_20240908_030634_Chrome Beta

This is in the activity. In devices, I got only one finamp client icon in the devices page (disconnect removes the previous device).

List of logins I tried with SSO user and user/pass user:

  1. SSO quick connect in both - failed (tried again rn)
  2. User/pass in both - failed (tried again rn)
  3. User/pass in one and quick connect in another - failed (tried again rn)
  4. Finamp version 0.9.9 and 0.9.8 in another - failed
  5. SSO quick connect from one account and user/pass or quick connect in another (AKA an account for a device/app) - works.

Jellyfin server version: 10.9.10

Chaphasilor commented 1 week ago

Okay, thanks for the info. I don't have a second android device to test with at the moment, but I have no issues signing in with my phone (Android) and my laptop (Windows) using 0.9.9...

Could you please try it with the official Jellyfin app and report if that works?

BaccanoMob commented 6 days ago

Just installed the official app and it works on both devices simultaneously (device page registers new device after login). I don't get 401 error.

Not sure if this is useful or not, official Android uses Android logo and "device name" while finamp uses its logo and device "model name". When different device connects I think the model name gets updated (not sure how this works). Settings a display name does not help either.

Correction from my previous comment: apparently being disconnected does not remove from the device list. More like being inactive or something not related to this issue.

BaccanoMob commented 6 days ago

Just installed 0.6.23 in my devices and it works simultaneously. (Reinstalling to 0.9.9 did not work simultaneously though).

Apparently 0.6.23 uses "model name" as well. Maybe including quick connect auth in 0.9 beta might have introduced this bug?

BaccanoMob commented 6 days ago

Btw I downloaded and built windows exe. It does connect simultaneously and probably why this bug was not caught.

This issue might be Android specific. (Can't speak for iOS/mac)

Chaphasilor commented 4 days ago

Sadly my old phone died a few weeks ago, so I'm currently not able to test with two different devices.

But, I tried it with the release version and my development build, and it indeed didn't work. I now remember encountering this bug before, but I assumed it had something to do with the apps being on the same device. I will definitely investigate!

BaccanoMob commented 4 days ago

@Chaphasilor in #866 when I was posting my comment I noticed that the deviceid in the logs are the same for me and the OP. Which was UP1A.231005.007 maybe all android devices is getting the same id.

When different device connects I think the model name gets updated (not sure how this works). Settings a display name does not help either

This might be why the device name gets renamed when a new device is connected since the id is same.

Also Windows app had a UUID like string so a new device got created. So figuring out how the deviceid is set might solve this issue. Hope the info helps!

Komodo5197 commented 4 days ago

It looks like androidDeviceInfo.id was used as a unique ID, but it's actually a build id. UP1A.231005.007 is android-14.0.0_r1. I've thrown together #878 which should hopefully resolve this. Although that's mostly a guess, because this doesn't seem to reproduce for me.