nextcloud / nextcloud/android

Non-standard port is lost when opening Nextcloud file links from Talk Description

Open
#17,650 0 comments 0 reactions 0 assignees View on GitHub
0. Needs triage bug
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### ⚠️ Before posting ⚠️

- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).

### Steps to reproduce

When a Nextcloud instance is exposed through a non-standard HTTPS port, links to files shared in Nextcloud Talk are displayed correctly, including the port number.

However, when tapping the link in Talk, the port is lost and the URL is opened on the default HTTPS port 443.

The same URL works correctly when copied from Talk and pasted directly into a web browser.

Server is exposed through HTTPS on a non-standard port: 4446

Server URL
https://example.com:4446

Steps to reproduce

Configure a Nextcloud instance to be accessible at:

https://example.com:4446

Create or obtain a file link, for example:

https://example.com:4446/index.php/f/12345

Send this link in a Nextcloud Talk conversation.

In Talk, the link is displayed correctly with the port:

https://example.com:4446/index.php/f/12345

Tap the link.

### Expected behaviour

Expected behavior

The link should be opened using the original URL, including the non-standard port:

https://example.com:4446/index.php/f/12345

### Actual behaviour

When the link is opened from Talk, the port is lost and the resulting URL uses the default HTTPS port:

https://example.com/index.php/f/12345
The connection therefore goes to port 443 instead of 4446.

Important observation

If the URL is copied from Talk and pasted manually into Chrome/Firefox on the same Android device, it works correctly:

https://example.com:4446/index.php/f/12345

This indicates that the server, reverse proxy and URL itself are working correctly.

The problem only occurs when the link is opened by tapping it inside Talk.

### Android version

14

### Device brand and model

Xaiomi

### Stock or custom OS?

Stock

### Nextcloud android app version

24.0.4

### Nextcloud server version

34.1.1

### Using a reverse proxy?

I don't know

### Android logs

_No response_

### Server error logs

```bash

```

### Additional information

Possible relation to Nextcloud Android

This may be related to https://github.com/nextcloud/android/issues/12989, which describes problems with Nextcloud Android when using a server on a non-standard port.

Talk appears to recognize internal Nextcloud file links and hand them over to the Nextcloud Android application/file viewer rather than simply opening the original URI in the browser.

It would therefore be useful to check whether the port is being dropped while Talk hands the URL to Nextcloud Android, or while Nextcloud Android reconstructs the server URL from the configured account.

Additional information

The behavior can be summarized as:

Talk message

https://example.com:4446/index.php/f/12345
↓ tap
Nextcloud/Talk Android link handling

https://example.com/index.php/f/12345

port 443

Whereas:

Copy URL from Talk

Contributor guide

Open the contributing guide

Research direction

Start by tracing Talk's tapped-link handling into the Nextcloud Android application/file viewer, then compare it with the original URI used when the link is copied. Done means opening the file link preserves the non-standard port, such as :4446, rather than defaulting to port 443.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.