Poll: Upgrade Discourse?


  • ♿ (Parody)

    Supposedly they were rewriting the editor in ember or something, which would clobber our custom info, del / ins, etc stuff.



  • What's the difference between the two versions? Is there a list of bugs they have fixed? Just so I can take that number, multiply it by 5 and know how many new bugs to expect.


  • I survived the hour long Uno hand

    @Deadfast said:

    Is there a list of bugs they have fixed?

    :rofl:


  • Discourse touched me in a no-no place

    @Deadfast said:

    how many new bugs to expect

    NaN.


  • :belt_onion:

    I voted yes because /users/undefined is annoying. I presume they probably fixed that since it was a particularly obvious bug...


  • Discourse touched me in a no-no place

    Yes that got fixed shortly after our last Discoupgrae.


  • I survived the hour long Uno hand

    @loopback0 said:

    Yes that got fixed shortly after our last Discoupgraeregression.

    FTFY­


  • Discourse touched me in a no-no place

    Tom-ay-toe, tom-ah-toe.



  • Just an FYI and to put your concerns to the appropriate level, yes the Composer was rewritten, yes it is in the latest beta (may have been in the prior one too). Is it hard to work with? No.

    Here is an example:


  • Discourse touched me in a no-no place

    99 bugs on the tracker, 99 bugs on the tracker,
    you take one down, fix it all up,
    137 bugs on the tracker!

    Etc. I CBA to get the scansion right. And of course it's probably 237, not 137, for 💽🐎



  • Can issues be jeffed from their github repo?


  • Discourse touched me in a no-no place

    @fbmac said:

    issues

    @fbmac said:

    github

    :rofl:



  • Explain! Explain!


  • Discourse touched me in a no-no place

    Whoosh!

    They don't log issues on their GitHub. Just fail.d.



  • 88 + 11 = 100? :wtf:


  • Notification Spam Recipient

    @FrostCat said:

    I CBA to get the scansion right.
    If I'm interpreting this right then maybe I can adjust it a little?

    99 bugs on the disco-tracker, 99 bugs to be fixed,
    You Jeff one down, toss it around,
    237 bugs on the disco-tracker
    


  • Looks like just a rounding issue, no big deal



  • But he said

    @mott555 said:

    Strange, the poll values actually add up to 100% for once.


  • Notification Spam Recipient

    @rc4 said:

    But he said

    Exactly. Rounding issue. 😛



  • @loopback0 said:

    NaN

    +Inf


  • Winner of the 2016 Presidential Election Banned

    @loopback0 said:

    @Magus said:
    there's a chance that everything will immediately come to a crashing halt, due to some kind of if(tdwtf)if(discourse)

    Yes.

    That can easily be fixed by a simple

    try{
        
    }catch(Exception discHorse){
        
    }

  • ♿ (Parody)

    @Deadfast said:

    ? Is there a list of bugs they have fixed?

    HAHAHAHAHA

    Oh HOHOHOHAHAH

    HEEEEE HAH HAH HUh huh

    Thanks, I needed that.



  • By the way, @PJH, I updated the importer, so if you want to try it with actual deleted post support, go ahead!


  • Grade A Premium Asshole

    @loopback0 said:

    I think we need an Official TDWTF™ Pub Thread. Founding members are, at the very least, @Weng and @PJH.

    :wtf:? How did I get forgotten on that list?



  • Does drinking at your house count? I mean, it's not exactly a pub, but...



  • Was this cancelled indefinitely or just temporarily?


  • BINNED

    @loopback0 said:

    Like when we figured out how to get the custom CSS menu back? 🛂

    Bloody hell, I forgot about it!

    Wait... Didn't I post some code for testing? I can't remember any more... someone remind me over the weekend please?


  • BINNED


  • Discourse touched me in a no-no place

    @Polygeekery said:

    How did I get forgotten on that list?

    They're the ones I remembered posting from a pub/brewery last night.


  • Discourse touched me in a no-no place

    @LB_ said:

    Was this cancelled indefinitely or just temporarily?

    I think we need another test instance with latest version on it to see what would need to be done.


  • Discourse touched me in a no-no place

    Current code for those interested:

    <script>
    /* Copyright (c) 2006-2013 Tyler Uebele * Released under the MIT license. * latest at https://github.com/tyleruebele/details-shim * minified by Google Closure Compiler */
    function details_shim(a){if(!(a&&"nodeType"in a&&"tagName"in a))return details_shim.init();var b;if("details"==a.tagName.toLowerCase())b=a.getElementsByTagName("summary")[0];else if(a.parentNode&&"summary"==a.tagName.toLowerCase())b=a,a=b.parentNode;else return!1;if("boolean"==typeof a.open)return a.getAttribute("data-open")||(a.className=a.className.replace(/\bdetails_shim_open\b|\bdetails_shim_closed\b/g," ")),!1;var c=a.outerHTML||(new XMLSerializer).serializeToString(a),c=c.substring(0,c.indexOf(">")),
    c=-1!=c.indexOf("open")&&-1==c.indexOf('open=""')?"open":"closed";a.setAttribute("data-open",c);a.className+=" details_shim_"+c;b.addEventListener("click",function(){details_shim.toggle(a)});Object.defineProperty(a,"open",{get:function(){return"open"==this.getAttribute("data-open")},set:function(a){details_shim.toggle(this,a)}});for(b=0;b<a.childNodes.length;b++)if(3==a.childNodes[b].nodeType&&/[^\s]/.test(a.childNodes[b].data)){var c=document.createElement("span"),d=a.childNodes[b];a.insertBefore(c,
    d);a.removeChild(d);c.appendChild(d)}}details_shim.toggle=function(a,b){b="undefined"===typeof b?"open"==a.getAttribute("data-open")?"closed":"open":b?"open":"closed";a.setAttribute("data-open",b);a.className=a.className.replace(/\bdetails_shim_open\b|\bdetails_shim_closed\b/g," ")+" details_shim_"+b};details_shim.init=function(){for(var a=document.getElementsByTagName("summary"),b=0;b<a.length;b++)details_shim(a[b])};
    window.addEventListener?window.addEventListener("load",details_shim.init,!1):window.attachEvent&&window.attachEvent("onload",details_shim.init);
    
    Discourse.TopicListComponent.reopen({
        showLikes: true
    });
    
    $("document").ready(function (){
        
    //  Monarch - http://what.thedailywtf.com/t/del-ins-corrector-composer-extension-userscript/48287
        window.PagedownCustom.appendButtons.push({
        	id:"wmd-del-button",
        	description:"del/ins correction",
        	execute:function(a){
        		a.before+="<del>"+a.selection+"</del><ins>";a.selection=" ";a.after="</ins>"+a.after
        	}
        });
        $(document.body).append('<style> .wmd-del-button::before {content: "\\f12d";}</style>');
        
    //  Monarch + boomzilla - abbr composer extension based on http://what.thedailywtf.com/t/del-ins-corrector-composer-extension-userscript/48287
        window.PagedownCustom.appendButtons.push({
        	id:"wmd-abbr-button",
        	description:"add abbr tag",
        	execute:function(a){
    			a.after = '">'+a.selection+"</abbr>"+a.after;a.before+='<abbr title="';a.selection=" ";
        	}
        });
        $(document.body).append('<style> .wmd-abbr-button::before {content: "\\f05a";}</style>');
    
    //  Monarch + PJH - spoiler composer extension based on http://what.thedailywtf.com/t/del-ins-corrector-composer-extension-userscript/48287
        window.PagedownCustom.appendButtons.push({
        	id:"wmd-spoil-button",
        	description:"add [spoiler] tag",
        	execute:function(a){
    			a.after = "[/spoiler]"+a.after;a.before+='[spoiler]';
        	}
        });
        $(document.body).append('<style> .wmd-spoil-button::before {content: "\\f070";}</style>');
        var View = require('discourse/views/header').default;
        Em.View.views[$("header").attr("id")].set("renderDropdowns",true); //force discourse to render dropdown in background
    
      //inject custom menu items
      Em.run.next(function (){
         $('\
         <li>\
            <ul class="main_menu">\
                <li>\
                    <u>Custom Styles</u>\
                    <ul class="csssubmenu">\
                        <li><a data-auto-route="true" class="csslink" href=".?preview-style=5ac5a5e9-c6ed-4197-9ec3-40811fd6ee5d&amp;sticky=true">Discourse Default</a></li>\
                        <li><a data-auto-route="true" class="csslink" href=".?sticky=true&amp;preview-style=">* TDWTF Default</a></li>\
                        <li><a data-auto-route="true" class="csslink" href=".?preview-style=2aeee392-5939-45a8-aaa8-eb7ca3282217&amp;sticky=true">Widescreen+min</a></li>\
                    </ul>\
                </li>\
            </ul>\
        </li>\
        ').insertAfter( $("#user-dropdown li:eq(3)") );
      });
    });
    
    // Show Raw button
    //http://what.thedailywtf.com/t/expanding-replies-hides-raw-button/7399/47?u=pjh
    (function(){
      //@Monarch at what.thedailywtf.com
      //Button is redelcared and sligthly modified due to new scope. it can be further simplified.
      Button = function(action, label, icon, opts) {
        this.action = action;
        this.label = label;
    
        if (typeof icon === "object") { this.opts = icon; } else { this.icon = icon;}
        this.opts = this.opts || opts || {};
    
        this.render = function (buffer){
            var opts = this.opts;
            buffer.push("<button title=\"" + this.label + "\"");
            if (opts.className) { buffer.push(" class=\"" + opts.className + "\""); }
            buffer.push(" data-action=\"" + this.action + "\">");
            if (this.icon) { buffer.push("<i class=\"fa fa-" + this.icon + "\"></i>"); }
            buffer.push("</button>");
        }
      };
    
    
    
        var PostMenuComponent = require('discourse/components/post-menu').default;
    
        PostMenuComponent.reopen({
          buttonForRaw:function(post){
              return new Button('raw', 'view raw post', 'code', {className: "raw-button", disabled: false});
          },
    
          clickRaw:function(post){
              var topicID = post.topic_id,
                  postID =  post.post_number,
                  postArea = $("article[data-post-id='"+post.id+"'] div.contents"),
                  $rawButton = $(this.element).find("button.raw-button"),
                  styles = [{backgroundColor: 'transparent', color: '#A7A7A7'},{backgroundColor: '#08C', color: '#FFF'}];
    
              if (postArea.find('.tdwtf-raw-area').length == 0){
                  var postArea_raw_content = $('<pre class="tdwtf-raw-area"></pre>'),
                      cooked = postArea.find('.cooked');
    
                      cooked.after(postArea_raw_content);
    
                  $.get('/raw/' + topicID + '/' + postID) .done(function (content) {
                      postArea_raw_content.addClass("active");
                      $rawButton.css(styles[1]);//active
                      postArea_raw_content.css({"white-space":"pre-wrap", 'border':'2px dashed #E7E7E7','padding':'3px'}) .text(content);
                      cooked.hide();
                  });
              } else {
                  var postArea_raw_content = postArea.find('.tdwtf-raw-area');
                  if ( !postArea_raw_content.hasClass("active") ){  //raw no active
                      postArea.find('.cooked').hide();  
                      postArea.find('.tdwtf-raw-area').show();
                      postArea_raw_content.addClass("active");
                      $rawButton.css(styles[1]);
                  } else{
                      postArea.find('.cooked').show();  
                      postArea.find('.tdwtf-raw-area').hide();
                      postArea_raw_content.removeClass("active");
                      $rawButton.css(styles[0]);
                  }
              }
          }
      });    
    })();
    </script>
    

    This includes everything (non-working menu items, details/summary shim)



  • Will upgrading Discourse make this stop happening?

    tl;dr: I'm too lazy to find a more appropriate thread to post this screenshot in.


  • kills Dumbledore

    @LB_ said:

    Will upgrading Discourse make this stop happening?

    @boomzilla said:

    HAHAHAHAHA

    Oh HOHOHOHAHAH

    HEEEEE HAH HAH HUh huh

    Thanks, I needed that

    <empty


  • Discourse touched me in a no-no place

    @LB_ said:

    Will upgrading Discourse make this stop happening?

    It might result in different shapes being produced....


  • Winner of the 2016 Presidential Election

    yes. the line will be horizontal and straight!
    As you know, permanently offline websites don't create interesting graphs.

    Filed Under: I still voted for "yes" :D



  • Nope, the server is under-provisioned for the posts per minute you lot are making.

    You're literally #7 in the world among {publicly-accessible Discourse sites where version checking is not turned off} when sorted by posts in the last 7 days.

    And 2 of the sites above you, on manual inspection, have suspicious numbers (probably an import or something).

    Which probably means #5 in real activity out of all sites.

    Hello Foros, Turtle Rock (EVOLVE), Gearbox Software (Borderlands), Infinite Flight (aviation? pilots? judge for yourself), TDWTF.


  • Discourse touched me in a no-no place

    @riking said:

    Nope, the server is under-provisioned for the posts per minute you lot are making.

    .. on the software-stack being used.



  • Correct. Less efficient runtime = more resources required.



  • Would it be possible to draw a dick with the response times graph?



  • Can 💽🏇 be load balanced?



  • Yes, that's what discourse.org hosting does. But they have HAProxy in front, and you need to split out the database server so that there's only one of it... it's pretty hairy.

    You can add more web workers by changing an environment variable, but that requires ~250MB ram each or something? Basically, more resources in general.



  • @riking said:

    Yes, that's what discourse.org hosting does.

    Wow, I didn't know it might actually be worth it to pay to have it set up. Huh.

    @riking said:

    split out the database server so that there's only one of it

    Doesn't sound unreasonable.

    @riking said:

    You can add more web workers by changing an environment variable, but that requires ~250MB ram each or something?

    @PJH, how many workers do we have, out of curiosity?



  • Is it possible the number of unicorns or sidekiqs or some customization to be screwing with TDWTF server? Or it is really the giant threads? Why don't they just delete that large threads?



  • @fbmac said:

    number of unicorns

    @riking said:

    more web workers

    Same thing.

    @fbmac said:

    Or it is really the giant threads?

    The giant topics are certainly causing a lot of GC and extra network traffic that isn't strictly necessary. Again, fixing that is a pretty big engineering problem due to cruft in the TopicView (which represents a "view" into a topic) code.

    Giant threads means you need more RAM per web worker, because they're in different processes, because Ruby has a GIL.


  • Discourse touched me in a no-no place

    @rc4 said:

    @PJH, how many workers do we have, out of curiosity?

    pjh@what:~$ cat /var/discourse/containers/app.yml | grep -i unicorn -B2
      ## TODO: How many concurrent web requests are supported?
      ## With 2GB we recommend 3-4 workers, with 1GB only 2
      UNICORN_WORKERS: 4
    pjh@what:~$ free -m
                 total       used       free     shared    buffers     cached
    Mem:          3953       3830        123       1038          2       1339
    -/+ buffers/cache:       2487       1465
    Swap:         1023        479        544
    pjh@what:~$ 
    

    I suppose, technically, we could up that to - say - 6 to see what happens, but that would require a rebuild of the container.

    Which will end up pulling the update in with it anyway.


  • Discourse touched me in a no-no place

    @riking said:

    what discourse.org hosting does.

    Leak data between customers? That's a new method of load balancing.


  • Discourse touched me in a no-no place

    :eek:

    👿



  • I think it's worth trying. You could probably lock the version changing the git command inside the yml. I think @blakeyrat could do it, he loves messing with git command line. (and notifications)



  • By the way, I'm updating the composer buttons. In the test-fix cycle now.



  • Here you go.

    tdwtf.dcstyle.json (8.8 KB)

    <script>
    (function() {
    /* Copyright (c) 2006-2013 Tyler Uebele * Released under the MIT license. * latest at https://github.com/tyleruebele/details-shim * minified by Google Closure Compiler */
    function details_shim(a){if(!(a&&"nodeType"in a&&"tagName"in a))return details_shim.init();var b;if("details"==a.tagName.toLowerCase())b=a.getElementsByTagName("summary")[0];else if(a.parentNode&&"summary"==a.tagName.toLowerCase())b=a,a=b.parentNode;else return!1;if("boolean"==typeof a.open)return a.getAttribute("data-open")||(a.className=a.className.replace(/\bdetails_shim_open\b|\bdetails_shim_closed\b/g," ")),!1;var c=a.outerHTML||(new XMLSerializer).serializeToString(a),c=c.substring(0,c.indexOf(">")),
    c=-1!=c.indexOf("open")&&-1==c.indexOf('open=""')?"open":"closed";a.setAttribute("data-open",c);a.className+=" details_shim_"+c;b.addEventListener("click",function(){details_shim.toggle(a)});Object.defineProperty(a,"open",{get:function(){return"open"==this.getAttribute("data-open")},set:function(a){details_shim.toggle(this,a)}});for(b=0;b<a.childNodes.length;b++)if(3==a.childNodes[b].nodeType&&/[^\s]/.test(a.childNodes[b].data)){var c=document.createElement("span"),d=a.childNodes[b];a.insertBefore(c,
    d);a.removeChild(d);c.appendChild(d)}}details_shim.toggle=function(a,b){b="undefined"===typeof b?"open"==a.getAttribute("data-open")?"closed":"open":b?"open":"closed";a.setAttribute("data-open",b);a.className=a.className.replace(/\bdetails_shim_open\b|\bdetails_shim_closed\b/g," ")+" details_shim_"+b};details_shim.init=function(){for(var a=document.getElementsByTagName("summary"),b=0;b<a.length;b++)details_shim(a[b])};
    window.addEventListener?window.addEventListener("load",details_shim.init,!1):window.attachEvent&&window.attachEvent("onload",details_shim.init);
    
    var TopicListComponent = require('discourse/components/topic-list').default,
        HeaderView = require('discourse/views/header').default;
        onToolbarCreate = require('discourse/components/d-editor').onToolbarCreate,
        hes = Handlebars.Utils.escapeExpression;
    
    TopicListComponent.reopen({
        showLikes: true
    });
    
    function forceDropdownRender() {
      // TODO broken
      // TODO - plugin outlet user-custom-preferences??
      //force discourse to render dropdown immediately
      Em.View.views[$("header").attr("id")].set("renderDropdowns",true);
      //inject custom menu items
      Em.run.next(function (){
         $('\
         <li>\
            <ul class="main_menu">\
                <li>\
                    <u>Custom Styles</u>\
                    <ul class="csssubmenu">\
                        <li><a data-auto-route="true" class="csslink" href=".?preview-style=5ac5a5e9-c6ed-4197-9ec3-40811fd6ee5d&amp;sticky=true">Discourse Default</a></li>\
                        <li><a data-auto-route="true" class="csslink" href=".?sticky=true&amp;preview-style=">* TDWTF Default</a></li>\
                        <li><a data-auto-route="true" class="csslink" href=".?preview-style=2aeee392-5939-45a8-aaa8-eb7ca3282217&amp;sticky=true">Widescreen+min</a></li>\
                    </ul>\
                </li>\
            </ul>\
        </li>\
        ').insertAfter( $("#user-dropdown li:eq(3)") );
      });
    }
    
    if (window.requestIdleCallback) {
        requestIdleCallback(forceDropdownRender);
    } else {
        forceDropdownRender();
    }
    
    onToolbarCreate(function(toolbar) {
      // © Monarch + Riking
      toolbar.addButton({
        id: "del_ins_button",
        icon: "eraser",
        group: "extras",
        perform: function(e) {
          var sel = e.selected;
          e.applySurround(function() {
            return "<del>" + e.selected.value + "</del><ins>";
          }, "</ins>", "replacement text");
        }
      });
    
      // © Monarch + boomzilla + Riking
      toolbar.addButton({
        id: "abbr_button",
        icon: "info-circle",
        group: "extras",
        perform: function(e) {
          var sel = e.selected.value;
          if (sel.length === 0) {
            e.applySurround("<abbr title=\"spelled out\">", "</abbr>", "ACRONYM");
          } else if (sel.indexOf('\n') !== -1) {
            // <abbr> is an inline element, not a block element
            if (e.error) {
              e.error("Cannot apply abbreviation to multiline selection");
            } else {
              console.error('cannot apply abbreviation to multiline selection');
              e.addText(sel + '<!--​ Invalid operation -->');
            }
          } else {
            var wordSplit = sel.split(' ');
            var suggestion = wordSplit.map(function(word) {
              return word.substr(0,1).capitalize();
            }).join('');
            // force use of suggestion. This seems to work, but is probably extremely fragile.
            e.selected.value = suggestion;
            e.applySurround(function() {
              return "<abbr title=\"" + hes(sel) + "\">";
            }, "</abbr>", suggestion);
          }
        }
      });
    
      // © Monarch + PJH + Riking
      toolbar.addButton({
        id: "td_spoiler_button",
        icon: "eye-slash",
        group: "extras",
        perform: function(e) { e.applySurround('[spoiler]', '[/spoiler]', 'blurred text'); }
      });
    });
    
    // Show Raw button
    //http://what.thedailywtf.com/t/expanding-replies-hides-raw-button/7399/47?u=pjh
    //@Monarch at what.thedailywtf.com
    //Button is redelcared and sligthly modified due to new scope. it can be further simplified.
      Button = function(action, label, icon, opts) {
        this.action = action;
        this.label = label;
    
        if (typeof icon === "object") { this.opts = icon; } else { this.icon = icon;}
        this.opts = this.opts || opts || {};
    
        this.render = function (buffer){
            var opts = this.opts;
            buffer.push("<button title=\"" + this.label + "\"");
            if (opts.className) { buffer.push(" class=\"" + opts.className + "\""); }
            buffer.push(" data-action=\"" + this.action + "\">");
            if (this.icon) { buffer.push("<i class=\"fa fa-" + this.icon + "\"></i>"); }
            buffer.push("</button>");
        }
      };
    
    
    
        var PostMenuComponent = require('discourse/components/post-menu').default;
    
        PostMenuComponent.reopen({
          buttonForRaw:function(post){
              return new Button('raw', 'view raw post', 'code', {className: "raw-button", disabled: false});
          },
    
          clickRaw:function(post){
              var topicID = post.topic_id,
                  postID =  post.post_number,
                  postArea = $("article[data-post-id='"+post.id+"'] div.contents"),
                  $rawButton = $(this.element).find("button.raw-button"),
                  styles = [{backgroundColor: 'transparent', color: '#A7A7A7'},{backgroundColor: '#08C', color: '#FFF'}];
    
              if (postArea.find('.tdwtf-raw-area').length == 0){
                  var postArea_raw_content = $('<pre class="tdwtf-raw-area"></pre>'),
                      cooked = postArea.find('.cooked');
    
                      cooked.after(postArea_raw_content);
    
                  $.get('/raw/' + topicID + '/' + postID) .done(function (content) {
                      postArea_raw_content.addClass("active");
                      $rawButton.css(styles[1]);//active
                      postArea_raw_content.css({"white-space":"pre-wrap", 'border':'2px dashed #E7E7E7','padding':'3px'}) .text(content);
                      cooked.hide();
                  });
              } else {
                  var postArea_raw_content = postArea.find('.tdwtf-raw-area');
                  if ( !postArea_raw_content.hasClass("active") ){  //raw no active
                      postArea.find('.cooked').hide();  
                      postArea.find('.tdwtf-raw-area').show();
                      postArea_raw_content.addClass("active");
                      $rawButton.css(styles[1]);
                  } else{
                      postArea.find('.cooked').show();  
                      postArea.find('.tdwtf-raw-area').hide();
                      postArea_raw_content.removeClass("active");
                      $rawButton.css(styles[0]);
                  }
              }
          }
      });
    })();
    </script>
    

Log in to reply