question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Links to https://dropbox.com/sh/example/thing in stream descriptions fail to save

See original GitHub issue

The new call to is_static_or_current_realm_url assumes that self.md.zulip_realm is defined: https://github.com/zulip/zulip/blob/ec99c1b58dc319fa3eaeaa883f6e18ed1add425c/zerver/lib/markdown/__init__.py#L584

This is not set for markdown descriptions of streams. As such, putting a URL of https://www.dropbox.com/sh/something/here into a stream description causes the description to fail to save, as rendering the markdown throws a 'NoneType' object has no attribute 'host' error: https://github.com/zulip/zulip/blob/ec99c1b58dc319fa3eaeaa883f6e18ed1add425c/zerver/lib/subdomains.py#L73

We should:

  1. Error-proof is_static_or_current_realm_url by fixing the type of realm to be Optional[Realm] and add realm is not None and before the check on line 73
  2. Fix do_change_stream_description to pass down the realm to the markdown renderer, so that we do get a realm in that spot, and can make use of it.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
PIG208commented, Oct 28, 2022

OK, looking into this.

0reactions
PIG208commented, Oct 29, 2022

Note that part of this (typing and None-checking) has been fixed in #23159. #23386 is mainly about fixing do_change_stream_description

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to force a shared link to download or render
Share Dropbox files the way you want. Learn how to share files as links that force files to download or render in the...
Read more >
HTTP - Developers - Dropbox.com
This endpoint performs User Authentication, validating the supplied access token, and returns the supplied string, to allow you to test your code and...
Read more >
Common sharing errors and how to solve them - Dropbox Help
Open your new shared folder. Paste files from the old folder into the new shared folder. Now, these files will sync with shared...
Read more >
Troubleshoot shared links - Dropbox Help Center
Whether you sent or received a shared link, it may fail to work or show a 404 error. If this happens, check the...
Read more >
How to share a link to a Dropbox file or folder
Click Save. On the Dropbox desktop app. Open the Dropbox folder in File Explorer (Windows) or Finder (Mac). Right-click ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found