Quantcast
Channel: Discourse Meta - Latest topics
Viewing all 60309 articles
Browse latest View live

Line breaks missing from embedded tweets

0
0

Buddy wrote:

Expected behaviour: tweet displays correctly.
Current behaviour: newlines missing.
Steps to reproduce: onebox the following tweet, or one like it
twitter.com/SirEvisiae/status/330541240443604992
Suggested fix: in TwitterStatusOnebox.raw, use client.oembed instead of client.status

Posts: 3

Participants: 2

Read full topic


Dropdown in Profile is a little bit too small

0
0

Gerhard wrote:

Is it possible to increase the width of the Dropdown for "Consider topics new when" a few pixel? Or is the width of 280px some kind of restriction because of mobile view?

One of the entries in the Dropdown doesn't fit when the English locale is used:

With the German locale only one of the options fits. All others have line breaks or are shown with an ellipsis.

Posts: 1

Participants: 1

Read full topic

Wrong localisation in Twitter one box

Why does Discourse not use Web Sockets

0
0

Sam Saffron wrote:

(This is an old topic I wrote on Dev that belongs here)

I wrote this a year and half ago, keep that in mind when reading.

Background

The "message bus" is component that allows us to easily publish information to our clients and between the rails processes in the farm. At its core it provides a few very simple APIs.

# publish a message to all subscribers on the particular channel
MessageBus.publish '/channel_name', data

# then on the server side you can
MessageBus.subscribe '/channel_name' do |msg|
  do_something msg.data
end

Or on the js client we can:

Discourse.MessageBus.subscribe('/channel_name', function(data){ /* do stuff with data*/ });

This simple apis hide a bunch of intricacies, we can publish messages to a subset of users:

MessageBus.publish '/private_channel', 'secret', user_ids: {1,2,3}

The message bus "understands" what site message belong to, transparently. Our rails apps have the ability to serve multiple web sites (eg: ember and dev are served in the same process - different dbs).

What changed?

I always really liked the API, its simple enough, however the bus itself was inherently unreliable. When the server sent messages to the client there was no Acking mechanism. If a server restarted there was no way for it to "catch up".

To resolve this I create an abstraction I call ReliableMessageBus, at its core it allows you to catch up on any messages in a channel. This involves some fairly tricky redis code, it means that when stuff is published on a redis channel it is also stored in a list:

def publish(channel, data)
  redis = pub_redis
  offset_key = offset_key(channel)
  backlog_key = backlog_key(channel)

  redis.watch(offset_key, backlog_key, global_id_key, global_backlog_key, global_offset_key) do
    offset = redis.get(offset_key).to_i
    backlog = redis.llen(backlog_key).to_i

    global_offset = redis.get(global_offset_key).to_i
    global_backlog = redis.llen(global_backlog_key).to_i

    global_id = redis.get(global_id_key).to_i
    global_id += 1

    too_big = backlog + 1 > @max_backlog_size
    global_too_big = global_backlog + 1 > @max_global_backlog_size

    message_id = backlog + offset + 1
    redis.multi do
      if too_big
        redis.ltrim backlog_key, (backlog+1) - @max_backlog_size, -1
        offset += (backlog+1) - @max_backlog_size
        redis.set(offset_key, offset)
      end

      if global_too_big
        redis.ltrim global_backlog_key, (global_backlog+1) - @max_global_backlog_size, -1
        global_offset += (global_backlog+1) - @max_global_backlog_size
        redis.set(global_offset_key, global_offset)
      end

      msg = MessageBus::Message.new global_id, message_id, channel, data
      payload = msg.encode

      redis.set global_id_key, global_id
      redis.rpush backlog_key, payload
      redis.rpush global_backlog_key, message_id.to_s << "|" << channel
      redis.publish redis_channel_name, payload
    end

    return message_id
  end
end

The reliable message bus allows anyone to catch up on missed messages (it also caps the size of the backlog for sanity)

With these bits in place it was fairly straight forward to implement both polling and long-polling, two things I had not implemented in the past. The key was that I had a clean way of catching up.

Why I hate web sockets and disabled them?

My initial implementation was unreliable, but web sockets made it mostly sort of work. With web sockets you have this false sense that its just simple enough just to hookup a few callbacks on your socket and all is good. You don't worry about backlogs, the socket is always up and everything else is an edge case.

However, web sockets are just jam packed full of edge cases:

  • There are a ton web socket implementations that you need to worry about: multiple framing protocols, multiple handshake protocols, and tons of weird bugs like needing to hack stuff so haproxy forgives some insane flavors of the protocol
  • Some networks (and mobile networks) decide to disable web sockets altogether, like Telstra in Australia
  • Proxies disable them
  • Getting SSL web sockets to work is a big pain, but if you want web sockets to work you must be on SSL.
  • Web sockets don't magically catch up when you open your laptop lid after being closed for 1 hour.

So, if you decide to support web sockets you carry a big amount of code and configuration around, you also are forced to implement polling anyway cause you can not guarantee clients support it, cause networks may and do disable them.

My call is that all this hoop jumping and complex class of bugs that would follow it is just not worth it. Given that nginx can support 500k reqs a second our bottleneck is not the network. Our bottleneck for the message bus is Ruby and Redis, we just need to make sure those bits are super fast.

I really hate all the buzz around web sockets, so much of it seems to be about how cool web sockets are, a lot less is based on evidence that sockets actually improve performance or even network performance in a way that significantly matters. gmail is doing just fine without web sockets.

This makes it easier to deploy Discourse

Now that I rid us of the strong web socket dependency and made "long polling" optional (in site settings) many can deploy discourse on app servers like passenger, if they wish. It will not perform as well, updates will not be as instant, but it will work.


I wrote that about a year ago, but it is still pretty much true today.

Posts: 1

Participants: 1

Read full topic

Is it possible running discourse on a domain like example.com/forum/?

min_post_length is not enforced on the server for admins

Unable to edit type or delete badges created programatically

0
0

Michael Congiusta wrote:

I created a Discourse plugin (based off Sam's Github Badges plugin) to enable badges to be awarded to users for actions committed outside of Discourse itself.

I'd now like to change the type from bronze to silver or gold for some of the badges, but find that the dropdown is blocked. I'm also unable to delete the badges, so I can't remove the badges and recreate them either.

Posts: 5

Participants: 2

Read full topic

Discourse schema - is there an ER diagram available anywhere?


Fixed category positions option does not affect the dropdown categories list [v.0.9.9.14]

0
0

Anton wrote:

When I check the "fixed category positions" checkbox, I expect categories to be in the right order in the dropdown list of the Topic Editor. It looks as categories there are shown in the order of activity, which NEW users consider being confusing.

Posts: 3

Participants: 2

Read full topic

When a category becomes visible after its first pinned topic is edited, moderators have to re-login to see it in the dropdown box of the Topic Editor [v.0.9.9.14]

0
0

Anton wrote:

  1. Let an administrator A create a new category. Don't change its description yet (so it's unvisible on the categories page and in the dropdown box in Topic Editor).
  2. Let a moderator M login, see categories page and create at least one new topic.
  3. Let A write a description of the category - now it should be visible.
  4. Let M create a new topic. The dropdown box will not contain the category.
  5. Let M F5 their browser - still no luck.
  6. Let M logout and the login again. Everything is alright now.

Posts: 1

Participants: 1

Read full topic

An exception in JS file: Uncaught exception: TypeError: Cannot convert 'e' to object [v.0.9.9.14]

0
0

Anton wrote:

Uncaught exception: TypeError: Cannot convert 'e' to object
Url: http://www.kozovodstvo.info/assets/vendor-7ddb0b280f4995f261e599971fd67497.js
Line: 15
Window Location: http://www.kozovodstvo.info/t/pro-razdel-professionalnoe-kozovodstvo/16

Environment:

HTTP_HOST: www.kozovodstvo.info
REQUEST_URI: /logs/report_js_error
REQUEST_METHOD: POST
HTTP_USER_AGENT: Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.17
HTTP_ACCEPT: /
HTTP_REFERER: http://www.kozovodstvo.info/t/pro-razdel-professionalnoe-kozovodstvo/16
HTTP_X_FORWARDED_FOR: 193.108.51.79
HTTP_X_REAL_IP: 193.108.51.79

params:
  message: Uncaught exception: TypeError: Cannot convert 'e' to object
Url: http://www.kozovodstvo.info/assets/v
  url: http://www.kozovodstvo.info/assets/vendor-7ddb0b280f4995f261e599971fd67497.js
  line: 15
  window_location: http://www.kozovodstvo.info/t/pro-razdel-professionalnoe-kozovodstvo/16

Posts: 3

Participants: 2

Read full topic

Full-height categories dropdown could simplify category selection - even if there are less than 10 ones

0
0

Anton wrote:

When clicking on the dropdown box, we already do something with mouse, so if there are ~10 categories, chances are I'll just find a particular category by eyes and selected it by another (2nd) click.

Still, we can start typing immediately because the search input receives focus as soon as the dropdown box is opened.

Drawbacks (minor)

  • The only one that crosses my mind immediately is that we won't be able to click the same place to hide the opened dropdown box. But is it needed? I consider it is a minor one.

Advandages

  • More categories are visible in the dropdown
  • The mouse cursor will be somewhere in the middle of the list, allowing us to scroll immediately with the mouse wheel (we can't do so now because after the dropdown is shown, the mouse is not above the scrollable area).

Mock-up

Posts: 2

Participants: 2

Read full topic

Cannot install discource in windows azure

0
0

Ray Dobie wrote:

when i "sudo ./launcher bootstrap app" i got this finally: how to solve this?(UBUNTU 12 LTS)

INFO -- : > cd /var/www/discourse && gem update bundler
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://rubygems.org/specs.4.8.gz)
I, [2014-07-31T09:03:51.163022 #38] INFO -- : Updating installed gems

2014-07-31 09:03:51 UTC LOG: received smart shutdown request
173 | signal handler Received SIGTERM, scheduling shutdown...
2014-07-31 09:03:51 UTC LOG: autovacuum launcher shutting down
2014-07-31 09:03:51 UTC LOG: shutting down
[173] 31 Jul 09:03:51.186 # User requested shutdown...
[173] 31 Jul 09:03:51.186 * Saving the final RDB snapshot before exiting.
[173] 31 Jul 09:03:51.234 * DB saved on disk
[173] 31 Jul 09:03:51.234 # Redis is now ready to exit, bye bye...
2014-07-31 09:03:51 UTC LOG: database system is shut down
/pups/lib/pups/exec_command.rb:85:in spawn': cd /var/www/discourse && gem update bundler failed with return #<Process::Status: pid 272 exit 1> (RuntimeError)
from /pups/lib/pups/exec_command.rb:55:in
block in run'
from /pups/lib/pups/exec_command.rb:53:in each'
from /pups/lib/pups/exec_command.rb:53:in
run'
from /pups/lib/pups/command.rb:6:in run'
from /pups/lib/pups/config.rb:85:in
block (2 levels) in run_commands'
from /pups/lib/pups/config.rb:76:in each'
from /pups/lib/pups/config.rb:76:in
block in run_commands'
from /pups/lib/pups/config.rb:75:in each'
from /pups/lib/pups/config.rb:75:in
run_commands'
from /pups/lib/pups/config.rb:71:in run'
from /pups/lib/pups/cli.rb:31:in
run'
from /pups/bin/pups:8:in `'
4df14c4d2c07fc9a324b05760e49d3f52f55eda7ccd85480357b561fcab47c9d
FAILED TO BOOTSTRAP

Posts: 1

Participants: 1

Read full topic

Prevent Badge IDs of less than 100?

Settings -> Content -> Textarea is not expandable

0
0

Anton wrote:

Could we allow expanding the textarea vertically by dragging its right bottom corner?

Posts: 1

Participants: 1

Read full topic


Rebuild Failing

0
0

Resurrectedstar wrote:

Hi, I am getting a rebuild failure as of right now

/pups/lib/pups/exec_command.rb:85:in `spawn': cd /var/www/discourse && sudo -E -u discourse bundle exec rake db:migrate failed with return #<Process::Status: pid 285 exit 1> (RuntimeError)
    from /pups/lib/pups/exec_command.rb:55:in `block in run'
    from /pups/lib/pups/exec_command.rb:53:in `each'
    from /pups/lib/pups/exec_command.rb:53:in `run'
    from /pups/lib/pups/command.rb:6:in `run'
    from /pups/lib/pups/config.rb:85:in `block (2 levels) in run_commands'
    from /pups/lib/pups/config.rb:76:in `each'
    from /pups/lib/pups/config.rb:76:in `block in run_commands'
    from /pups/lib/pups/config.rb:75:in `each'
    from /pups/lib/pups/config.rb:75:in `run_commands'
    from /pups/lib/pups/config.rb:71:in `run'
    from /pups/lib/pups/cli.rb:31:in `run'
    from /pups/bin/pups:8:in `<main>'

Though this might be because I just moved this docker from another host, I am not sure.

Posts: 5

Participants: 2

Read full topic

User with no mod is able to move topics

0
0

Nathan Rijksen wrote:

I have a user (currently the only non-admin/mod that has trust level 3) that is able to move topics, he does not have mod or admin nor do any Categories have special security settings for trust level 3.

Why is it that he is able to move topics? Is this a bug or something that is by design, and if the latter - can I configure it somewhere?

Posts: 4

Participants: 3

Read full topic

Odd white space appearing on the side of the forum

0
0

Resurrectedstar wrote:

I recently did a reinstall of discourse due to postgres deciding to corrupt my database. I used the same custom CSS on the new forum.

Oddly, there is now a large white space on the right side of the forum, and it refuses to go away.

Any idea what is causing it?

Site: https://forums.sandydprod.com/

Posts: 5

Participants: 3

Read full topic

Missing key in English locale

0
0

Gerhard wrote:

When I try to reset my password I get the following error:

Password translation missing:
de.activerecord.errors.models.user.attributes.password.too_short

I've looked in the German and English locale file (server.en.yml) and it seems like this key is missing in both files.

Posts: 2

Participants: 2

Read full topic

How to translate strings with key "js.notifications..."

0
0

Gerhard wrote:

There are a few strings where I don't know how they are supposed to be translated.

For example: js.notifications.mentioned which has the following text in English:
<span title='mentioned' class='icon'>@</span> {{username}} {{link}}

Where / how can I find this in the UI? Are we supposed to translate the content of the title attribute (in this case "mentioned")?

Posts: 4

Participants: 3

Read full topic

Viewing all 60309 articles
Browse latest View live




Latest Images