Babble - A Chat Plugin

Ok, this is fixed in latest! :pineapple:

3 Likes

Thank you for being so fast!

Are the English sources automatically updated on Transifex?

EDIT: is is updated now, thanks.

I was able to change the text that said “Channels” in the past and now I cannot… I changed it to something dumb and it’s stuck. Can you please help?

The wrapper for the text that I am unable to change now is “babble-topic-switcher-title” :confused:

Hi @AirRockStar

You should be able to do this in Admin => Customize => Text Content, the key you’re looking for is js.babble.select_topic

<yoursite.com>/admin/customize/site_texts/js.babble.select_topic
1 Like

We just installed this plugin on our community and users like it very much.

However, we got several reports of lags when typing replies on mobile (from mid-range devices I would say). Characters appear with a significant delay. Do you think that is specific to this plugin or more generally to the topic engine of Discourse? What could be done to mitigate this performance issue?

N.B.: We are running Discourse stable.

I’ll have a look in the next bit; I’m aware of a performance issue with long (300+) posts loaded at the same time, and unfortunately this solution doesn’t work right out of the box (or, rather, it does speed up the performance, but it breaks several things like hitting ‘up’ to edit your last post, and automatically updating posts when people edit or delete them, etc.)

So I’ll have to dig a bit deeper into that to figure out a fix; it’s definitely on the list of things to work on.

EDIT: This should now be much improved by this commit; let me know if you’re still experiencing problems like this on latest @gkln?

1 Like

Great, thanks for looking into this!

However, I’m unable to test this change as the latest Babble commit breaks on our dev instance running Discourse stable. See the log below:

Message
NameError (uninitialized constant User::HideChatNotifications::DB)
/var/www/discourse/plugins/babble/app/models/user.rb:26:in `unread_notifications'

Backtrace
/var/www/discourse/plugins/babble/app/models/user.rb:26:in `unread_notifications'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:99:in `block in attribute'
(eval):7:in `_fast_attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:467:in `rescue in attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:454:in `attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:479:in `_serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:361:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:349:in `as_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/json/encoding.rb:33:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/json/encoding.rb:20:in `encode'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/core_ext/object/json.rb:39:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.3/lib/active_model/serializer.rb:333:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json/adapter.rb:25:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json.rb:139:in `dump'
/var/www/discourse/app/controllers/application_controller.rb:493:in `preload_current_user_data'
/var/www/discourse/app/controllers/application_controller.rb:300:in `preload_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:413:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:197:in `block (2 levels) in halting'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in <module:Callbacks>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:198:in `block in halting'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:507:in `invoke_before'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:130:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_controller/metal/rescue.rb:20:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.1.4/lib/active_record/railties/controller_runtime.rb:22:in `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/abstract_controller/base.rb:124:in `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionview-5.1.4/lib/action_view/rendering.rb:30:in `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiling_methods.rb:104:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_controller/metal.rb:189:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_controller/metal.rb:253:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:31:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/mapper.rb:46:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/journey/router.rb:33:in `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:834:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.1/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:200:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in `context'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:97:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/callbacks.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-1.2.9/lib/logster/middleware/reporter.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:36:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/rack/logger.rb:26:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/request_id.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiler.rb:285:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/message_bus-2.1.5/lib/message_bus/rack/middleware.rb:63:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:186:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.1.4/lib/rails/railtie.rb:185:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:701:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `<main>'

It’s really weird, but somehow I can’t see or just delete any topic created by Babble Plugin which was removed before:

image

Hmm, some hint which may be useful for Discourse Team (or some experienced person)… I clicked on the blue dot next to the topic, which means it’s new. The content isn’t displayed, a tool appears on the right to delete it and I clicked it. The topic is still on the forum. :confused: I got this error in the console:

Oooof, stable is actually a bit old at the moment (~1.4k commits behind master); the deprecation error was put in July 20, so I’d assume the DB functionality was put in before that.

https://github.com/discourse/discourse/commit/44091f20c6e3530b4b97f1258d0d4d855621eff0#diff-6b762b989da3978cbbbae52732c72346

Any idea when we’ll get a stable version bump @sam?

In the meantime, I’ve cut a branch called stable which you can pull; it shouldn’t affect this functionality.

git clone -b stable git@github.com:gdpelican/babble.git
1 Like

@Sevosik You can get rid of those by running

# to hide topics from the interface, but keep in the DB in case you need to restore them (recommended)
Topic.where(archetype: :chat).update_all(deleted_at: Time.now)
# to remove chat topics and their content from the database completely
Topic.where(archetype: :chat).destroy_all
Group.where(visibility_level: 4).destroy_all

in your rails console.

1 Like

Currently scheduled for September 10th

2 Likes

Expect a bump in stable in 1-2 weeks

2 Likes

Awesome, it worked. Thanks :wink:

1 Like

I am not receiving notifications of new chats in Groups or Categories, PM notifications are working. I see nothing in the logs and just updated everything this morning. Also when I view a PM the notification count is not clearing out consistently. There is nothing in the logs currently.

Alright, I’ve pushed a fix to be a bit more secure about ‘reading’ things on the server when you see them (before we did it on scroll, now we do it on scroll and if the post is in view when the chat’s opened)

I wasn’t able to reproduce any problems with group or category notifications; can you be a bit more specific about which notifications you’re expecting and not receiving?

Hello,

First of all, thank you for the plugin.

Most of our users use their phones to reach the board. When they open the chat the form to text a message opens instantly. On a phone it means half of the screen is cut off.

Before the textarea you could create a hidden input in order to put the focus on it.

1 Like

Thanks for the report, that change makes sense to me. I’ve made the change, but won’t get a chance to push it until tomorrow. :beach_umbrella:

1 Like

Hi! I think I’ve got an interesting issue here!

The user preference pane now allows you to disable Babble completely. That works, check the checkbox and click save and it’s gone. However, if you want Babble back, then unchecking the box and clicking save doesn’t work. It’ll tell you it saved the settings, but once you reload the screen, the checkbox is checked again.

I’ve tried it with the following version:

  • Discourse v.2.2.0-beta2 +5
  • Babble version 8fc6664 - this is identical to master (I just upgraded to the now latest version)
1 Like

I reckon that’ll have to do with @david’s custom setting changes, which I’m aware of but will need to grab some time to properly look at in the near future.

EDIT: This should now be fixed in latest.

3 Likes